Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event.preventDefault is not a function after clicking out of a textarea/input/html-editor #190

Open
P-Panayiotou opened this issue Jul 5, 2021 · 2 comments

Comments

@P-Panayiotou
Copy link

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(); }

@WengKailong
Copy link

having the same issue here!

@Virendraccc
Copy link

Virendraccc commented Jan 11, 2023

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",

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants