feat request: conditioning `preventdefault:event `
See original GitHub issueIs your feature request related to a problem?
Implementing a search box, need a way to skip keydown event only when the key is ArrowUp
, ArrowDown
Describe the solution you’d like
let attribute value be more descriptive by certain structure ? such as preventdefault:keydown="{ key: ['arrow'] }"
?
Describe alternatives you’ve considered
- Considering Vue have event key modifier like
@keydonw.enter
we can do the similarpreventdefault:keydown.enter
? - add a special way to bind event handle in sync for edge case that have to prevent dynamically ?
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Event.preventDefault() - Web APIs | MDN
The preventDefault() method of the Event interface tells the user agent that if the event does not get explicitly handled, its default ...
Read more >How to prevent default event handling in an onclick method?
Let your callback return false and pass that on to the onclick handler: <a href="#" onclick="return callmymethod(24)">Call</a> function callmymethod(myVal){ ...
Read more >preventDefault() Event Method - W3Schools
The preventDefault() method cancels the event if it is cancelable, meaning that the default action that belongs to the event will not occur....
Read more >preventDefault() Event Method - GeeksforGeeks
It can prevent the user from processing the request by clicking the link. Syntax: event.preventDefault(). Parameters: It does not accept any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Custom events? Although, I thunk the solution there should be more automatic than manual.
https://github.com/BuilderIO/qwik/issues/786
Yeah, I’d be curious how much it adds to the Qwikloader size. I don’t know if the simple rules are an issue for most use cases. I mean, as of right now preventDefault with no conditions seems to work for 99.9% of the use cases.