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 #2

Open
belugasanity opened this issue Sep 1, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@belugasanity
Copy link
Contributor

Quoting issue from original repo - dmacfarlane/angular-mentions#190

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

@belugasanity belugasanity added the bug Something isn't working label Sep 1, 2021
@ashish-beetle
Copy link

Hi any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants