Input Fires Keypress Event Twice

后端 未结 8 2227
小蘑菇
小蘑菇 2021-02-18 14:26

This question has been asked/answered (mostly) before, BUT I\'ve tried three things to stop the event from bubbling but nothing has worked:

return false;
e.stopPr         


        
8条回答
  •  悲哀的现实
    2021-02-18 14:46

    I had this issue using Angular 11 EventEmitters. I solved it by creating a new instance of my event emitter whenever the event is triggered.

    @Output() keypress = new EventEmitter();
    onKeyPress(event) {
       this.keypress = new EventEmitter();
       this.keypress.emit(event);
     }
    

提交回复
热议问题