Update deprecated keyboard handling events in JS
|Target version:||Release 2.6.0|
|Google Code Legacy ID:||Tested version:||2.4, 2.5|
Related to a user forum thread discussion, 2018-01-15: https://groups.google.com/d/msg/ica-atom-users/dxd5atjGvso/v194ABlICgAJ
We currently use "keypress" to respond to user keyboard input in the global search box, for allowing using the arrow keys to navigate the drop-down menu. In issue #11944 we fixed a small bug in relation to this.
However, through the forum discussion, it's been brought to our attention that keypress is now deprecated, and should likely be updated. See for example:
beforeinput is still considered experimental - though support has been implemented in WebKit based browsers like Chrome and Safari, it may be too soon for users with older browsers. However, we could use keydown:
There are other deprecated event calls in our JS code as well. From the forum:
Adding to this, there are other deprecations: "keyboardEvent.keyCode" or "keyboardEvent.which", for instance, should be replaced by "keyboardEvent.key" (and those are used in this file as well).
We should review our JS code and update these deprecated event calls.
#3 Updated by Mike Cantelon 2 months ago
keyCode event property is also deprecated:
Switching to use of
which, which jQuery will set even if a browser still only uses