angular-mentions
angular-mentions copied to clipboard
event.preventDefault is not a function after clicking out of a textarea/input/html-editor
Hello,
I get the error event.preventDefault is not a function after I click out of a textarea/input/html-editor.
The whole error message is:
core.js:15724 ERROR TypeError: event.preventDefault is not a function at MentionDirective.stopEvent (angular-mentions.js:567) at MentionDirective.blurHandler (angular-mentions.js:573) at Object.eval [as handleEvent] (AddEmailTemplateComponent.ngfactory.js:138) at Object.handleEvent (core.js:23107) at Object.handleEvent (core.js:23652) at dispatchEvent (core.js:20556) at core.js:22046 at SafeSubscriber.schedulerFn [as _next] (core.js:13527) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:192) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:130)
I found this issue is happening because at the line 566 of file angular-mention.js the code block(see below) is missing some conditions when the event is blur:
stopEvent(event) { **// The event here is blur and does not have a method preventDefault()** if (!event.wasClick) { event.preventDefault(); event.stopPropagation(); event.stopImmediatePropagation(); }
having the same issue here!
Facing ERROR TypeError: event.preventDefault is not a function - when we focus out of ckeditor
"angular-mentions": "^1.5.0", "@ckeditor/ckeditor5-build-decoupled-document": "^26.0.0", "@angular/core": "^14.0.0",