Open ghost opened 5 years ago
Referring: https://caniuse.com/#feat=keyboardevent-code, IE lack keyboardevent-code support yet.
Solution - tried using: let code1 = ''; if (!event.code) { if (event.keyCode) { if (event.keyCode === 40) { code1 = 'ArrowDown'; } else if (event.keyCode === 38) { code1 = 'ArrowUp'; } } } else { code1 = event.code; }
So need fixes or if poly-fill can be used. Please let me know, if I can raise a PR for the same.
I found out this polyfill here helps: https://github.com/inexorabletash/polyfill/blob/master/keyboard.md
Referring: https://caniuse.com/#feat=keyboardevent-code, IE lack keyboardevent-code support yet.
Solution - tried using: let code1 = ''; if (!event.code) { if (event.keyCode) { if (event.keyCode === 40) { code1 = 'ArrowDown'; } else if (event.keyCode === 38) { code1 = 'ArrowUp'; } } } else { code1 = event.code; }
So need fixes or if poly-fill can be used. Please let me know, if I can raise a PR for the same.