Sebobo / Shel.Neos.CommandBar

A commandbar (CMK+K) for Neos CMS
MIT License
15 stars 2 forks source link

CMD+K / CTRL+K Shortcut and inputs not always captured by command bar plugin #8

Open Sebobo opened 1 year ago

Sebobo commented 1 year ago

Issues:

PRGfx commented 1 year ago

Ctrl+K conflicts with focusing the address bar in chrome and firefox on Windows and Linux, so while the command bar opens, the focus is gone. If that can't be prevented, maybe the shortcut could be configurable?

Sebobo commented 1 year ago

Oh thx for reporting the issue! I had several testers, but apparently all were Mac users. I was quite sure that CTRL+L would be the focus of the address bar like CMD+L is on the Mac. I wonder why all those command bar plugins then call themselves CMD+K 😔 Making it configurable wouldn't help much as the Neos backend will be used by a variety of users. I somehow must detect the available shortcut...

Sebobo commented 1 year ago

@PRGfx so which is the proper letter/key for this kind of action on Windows/Linux?

PRGfx commented 1 year ago

I'm not aware of a "common" practice for that, however coming from VSCode, Sublime Text and Chrome Dev-Tools I would expect Ctrl+Shift+P to open the command palette, which however also is a browser shortcut in chromium and firefox as far as I can tell.. Githubs preview-feature "Command Palette" also uses Ctrl+K and that works for me, so it seems to be possible to prevent a default.

Sebobo commented 1 year ago

Yes I was just told that it can be prevented and several websites apparently do that. So I will do that now too ;)

Sebobo commented 1 year ago

Hopefully resolved now, sadly cannot test it properly right now with my Windows VM

PRGfx commented 1 year ago

Unfortunately it doesn't seem fixed with 0.6.1 as far as I can tell. I tried looking into this, but the parts changed in 9935282 are working on event.metaKey, which shouldn't trigger for Ctrl+K, so I can't really see where the Commandbar comes from.. (Trying to build it locally, the compiler was complaining about missing type declarations btw.)

Sebobo commented 1 year ago

OK, now with 0.7.2 at least this problem should be done.

The behaviour in the guest frame also improved a bit. The link editor still opens when inline editing, but another shortcut press will open the command bar, so there is a way to reach it. On MacOS Ctrl+K works fine though. So not sure now whether and how to prevent the problem in CK. If users use the link hotkey then it would not be nice to prevent them from using it. So we could leave it like this for now and add a note to the readme ...