This question is related to this one Autocomplete: first item focused only when the user type on tab key.
In order to make the first item focused only when the user
You're correct: The event will be modified an all listeners will see the modified key code.
But the more important question is: Is this dangerous?
To answer this, we need to know which listeners are bound to the element. Surely, all the listeners from the autocomplete plugin are designed to handle this situation. For them, this is OK.
The trouble starts when you bind your own events to the widgets.
A solution would be to create new events (using document.createEvent()
+ copying all important attributes) and send the clone to avoid modifying the original event.
Some links: