Closed omar1989omb closed 5 years ago
@omar1989omb, you should change it to this:
editor.events.on('keydown', (keydownEvent) => {
if (keydownEvent.keyCode === 13 && this.tribute.isActive) {
e.preventDefault();
e.stopPropagation();
keydownEvent.preventDefault();
keydownEvent.stopPropagation();
console.log('Intilized');
return false;
}
}, **true**);
@omar1989omb, you should change it to this:
Solved, thank you very much.
Expected behavior.
I am using Froala + tributejs. When I detect the KeyDown Enter event and tribute isActive I want the event to end.
Actual behavior.
I am using Froala + tributejs. When I detect the KeyDown Enter event and tribute isActive, .preventDefault () and .stopPropagation () do not work.
Steps to reproduce the problem.
Attachment repository with code: https://github.com/omar1989omb/froalaangular
Jsfiddle returns errors with Froala and tribute
In app.component.ts is the sample code. I have used the detection in the initialized event as in keydown.
OS.
Linux Ubuntu 18.04
Browser.
Chrome, Firefox, Edge...