Choices
Choices copied to clipboard
KeyboardEvent
I discover this library that is great (thanks). But I noticed 2 points :
- in "constants" file for KEY_CODES object : BACK_KEY should be 8 (and not 46), and DELETE_KEY should be 46 (and not 8)
- The KeyboardEvent.keyCode is deprecated and should be replaced by KeyboardEvent.code
For example, export const BOARD_CODES = { BACK_KEY: "Delete", DELETE_KEY: "Backspace", ENTER_KEY: "Enter", A_KEY: "KeyA", ESC_KEY: "Escape", UP_KEY: "ArrowUp", DOWN_KEY: "ArrowDown", PAGE_UP_KEY: "PageUp", PAGE_DOWN_KEY: "PageDown" }; The type should be replaced too.
Thanks
- in "constants" file for KEY_CODES object : BACK_KEY should be 8 (and not 46), and DELETE_KEY should be 46 (and not 8)
Nice catch, I'd be happy to merge a PR with this change (and a change to the interface as well).
- The KeyboardEvent.keyCode is deprecated and should be replaced by KeyboardEvent.code
While keyCode is deprecated, that has been the case for at least 8 years and it's still supported by all browsers. code on the other hand is not supported by IE11 or many mobile browsers. For now we'll stick with keyCode.