remark42
remark42 copied to clipboard
Hotkeys work in EN layout only
Repro: switch keyboard to other language than English and press Ctrl+B.
Demo on Youtube (clickable):
We have hotkeys? :D
What system/browser? It seems to work on osx/firefox, though I hit cmd+b.
Also, can you check, if it works here on GitHub, since we use same package as github iirc
yeah, I was shocked too :) Had to watch a video to figure out what hotkeys we have
You can check out title on hover of each button, or just plain code :-) https://github.com/umputun/remark/blob/f0750c24335742da2b04cee6e38bbb67f972c44b/frontend/app/components/input/markdown-toolbar.tsx#L29-L37
What system/browser?
Vivaldi 2.6.1566.49 (Stable channel) (64-bit) Windows 10 OS Version 1903 (Build 18362.267)
Github have the same issue.
works for me on safari and chrome (both on macos).
It also works for me on osx/Vivaldi 2.6.1566.49 (Stable channel) (64-bit)
So, I guess it's either Vivaldi or @github/markdown-toolbar-element
Code related to this here https://github.com/github/markdown-toolbar-element/blob/dd0ffba8d9ad9d64471d3be41b3b7e1b77aa3545/index.js#L228-L236
Package adds hotkey
attribute to element and then searches for it on keydown. And it seems there is mismatch between hotkey
attr and event.key
.
@NikolayPetyukh if you have skill, can you please check, what hotkey
attribute if you click select inspect element
on any of the toolbar button? And then, is event.key
of keydown
event property is different on EN and RU layouts? https://w3c.github.io/uievents/tools/key-event-viewer.html
Chrome 76 on Windows 10. I confirm that the hotkeys only work on EN.
@Andrew-Shtein, thanks!
As I expected on Windows key
is different and it appears to be more close to spec. It's a markdown-toolbar-element issue. Made an issue there https://github.com/github/markdown-toolbar-element/issues/15
Reply from linked issue:
@ muan not bug. That's not issue. It's expected, if you wanna create multilanguage support just add another hotkey data to div, for example:
[hotkey${currentKeyboardLang}="${event.key}"]
We should not fix it on our side if the library doesn't support it: we then open a can of worms by trying to support the undocumented hotkey feature for dozens of languages we have. The only solution I think is appropriate is switching to another library which will do that.
Closing this as "won't fix", feel free to comment on the issue if your opinion differs from mine.