"keyup" or "input" best practice for autocomplete input field?
See original GitHub issueIn the https://angular.io/tutorial/toh-pt6#search-by-name tutorial, for the input field, the event “keyup” is used in the example: <input #searchBox id="search-box" (keyup)="search(searchBox.value)" />
But wouldn’t it be a better (best) practice to use the “input” event instead? Such that the input field also reacts on copy/paste via mouse for example?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
For a JavaScript autocomplete search box, must we use the ...
Entering input with keyboard (includes holding down a key). Triggers: keydown , keypress , input , keyup · Deleting input ( Backspace /...
Read more >How to implement autocomplete with JavaScript on your website
Go deep into autocomplete - the what and why, and the data and code to implement your own search autocomplete with JavaScript.
Read more >Place Autocomplete | Maps JavaScript API - Google Developers
The Place Autocomplete sample demonstrates how to use the Place Autocomplete widget to provide a type-ahead search box. The radio buttons allow you...
Read more >How To Build an Autocomplete Component in React
In this article you will learn how to build an autocomplete component in React using local state and some event handlers.
Read more >Building Autocomplete Search Component from Scratch
The keyup listener will be added to the input field using rxjs Observable fromEvent method on carInput variable which can notify us of...
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 Free
Top 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
Yes, that is true for sure. But why not lead with a good example? Chances are high, that this practice will influence future developments.
Current document uses the input event.