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

dom input eventListener default behaviour 🤔 #69

Open
LawEKS opened this issue Mar 23, 2018 · 0 comments
Open

dom input eventListener default behaviour 🤔 #69

LawEKS opened this issue Mar 23, 2018 · 0 comments

Comments

@LawEKS
Copy link

LawEKS commented Mar 23, 2018

The input eventListener has its third parameter set to false. But this optional parameter can be an object with a specific key to achieve your desired result.

If you want to preventDefault behaviour for submit button you can do

input.addEventListener("keyup", search, {passive: false})

But considering that you are listening for a "keyup" event.
What is the default behaviour of this?
Do you need to set this optional parameter?

Have a look at MDN for reference
EventTarget.addEventListener()

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

1 participant