fix: Update w3c-keyname to v2.2.8 #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR ensures that package managers will install the most recent version of
w3c-keyname.I realized that my
yarnhad installed an older version ofw3c-keynameon my side (2.2.6 instead of the most recent version 2.2.8). Something changed in between the two version that impacts macOS. Specifically, the older version'skeynamereported, as key name, for the shortcutCmd-Alt-∆on macOS ajcharacter, whereas 2.2.8 correctly reports∆.I noticed that because I am currently working on a shortcut capturer to let users define custom keyboard shortcuts, and I noticed that my implementation (which also relies on
keyNameto be consistent between my code and CodeMirror) outputted different key names from what CodeMirror saw.This may be even more detrimental, though, since before I installed
w3c-keyname, no other package depended on it, meaning that other users probably also have 2.2.6 installed. This might lead to false positives, and I remember that it is extremely difficult to find even hard-coded editor shortcuts for macOS that work consistently.My current mitigation is to put a resolution in my package json to enforce version 2.2.8.
A specific bug that this PR fixes for everyone that has 2.2.6 installed:
Imagine you have the keyboard shortcut
Cmd-Alt-Jthat you wish to use on macOS. You could do it like so:However, that will never trigger when using
w3c-keynameversion 2.2.6, because the keyboard event reports the character∆instead ofj. But, using the other version won't work either with version 2.2.6:When using
w3c-keynameversion 2.2.8, however, the keyboard shortcutCmd-Alt-∆will properly trigger, as expected.^2.2.4covers 2.2.8. I am not going to re-release all my packages every time a dependency gets a new version. You'll just have to clear your package lock or otherwise convince your package manager to not use the old version.sigh I should probably sit down and properly read the yarn manual again ... dependencies are hell. Sorry for the bother.
Pull request closed