WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.48k stars 4.18k forks source link

Block Editor: CTRL + S is not working anymore if the keyboard language is not English! #38230

Open Elgameel opened 2 years ago

Elgameel commented 2 years ago

Description

After updating to version 5.9 the CTRL + S shortcut is no longer working if the keyboard language is not English.

If the keyboard language is set to English, it saves changes as usual, but If I switch keyboard language to another language (i.e. Arabic) the shortcut is not captured by WordPress, and the browser's save page as window appears instead.

Step-by-step reproduction instructions

  1. Open WordPress Block Editor.
  2. Switch keyboard language to Arabic.
  3. Press CTRL + S.

Screenshots, screen recording, code snippet

No response

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

annezazu commented 2 years ago

Wondering if this is related https://github.com/WordPress/gutenberg/issues/38146

@Elgameel can you confirm this was working properly before 5.9?

Elgameel commented 2 years ago

@annezazu Yes, it was working before the update.

I was even writing a post when I received the update notification.

I saved the changes using the shortcut and updated WordPress, then I came back to continue writing when I found that the shortcut is not working anymore.

I opened a different browser, cleared all cache, tried different posts and the result is still the same!

annezazu commented 2 years ago

Thanks so much for following up with more context!

annezazu commented 2 years ago

I tried replicating this but was unable to:

https://user-images.githubusercontent.com/26996883/151245592-c9b86b1b-2185-4d0a-a77a-fe9366f6c935.mov

Flagging in core-test to see if we can get more help replicating!

Elgameel commented 2 years ago

I have retested it on a different English WordPress site, a different Windows 10 PC, and I still have the same problem.

ironprogrammer commented 2 years ago

I was unable to replicate this issue with the following test parameters:

Something that did come up, which I hadn't initially considered, is that the location of "S" can change between keyboard layouts. On the US keyboard S is the 2nd character key from the left in the middle row. However, in the Colemak layout, this shifts to the 3rd key from the left. For instance:

US Keyboard Layout US Keyboard Layout

Colemak Keyboard Colemak Keyboard Layout

So on Colemak, I needed to press Command + (3rd key from the left) to correctly Save.

Back to the Arabic layouts, I tried both the standard Arabic and "Arabic - QWERTY" input sources (out of the five available in macOS), but the primary (non-shifted) character in that 2nd position appears to remain the same: س. It appears, on macOS at least, that the mapping of "S" on these Arabic layouts is consistent with the 2nd position.

I think it would help to have some additional Windows 10/11 users test this out. I will also reach out to the #core-i18n team to find out if 5.9 introduced any changes to key codes that could be at play here.

tellthemachines commented 2 years ago

I can replicate this on Windows 11, on both Chrome and Firefox, with the keyboard layout set to "Arabic (Bahrain)". Instead of saving the post, Ctrl + S opens a "Save as" system dialog.

annezazu commented 2 years ago

Moving this to the 5.9.x board just in case this can be tracked down :) Thank you all so much for helping test.

Elgameel commented 2 years ago

Update: it seems that all Editor keyboard shortcuts are not working too.

I can confirm that the following shortcuts are not working:

paaljoachim commented 2 years ago

Testing.

WP 5.9.1. Norwegian input source.

Screenshot 2022-02-25 at 20 32 08

Theme: Just updated Twenty Twenty Two. Plugins: None activated. Chrome. OSX 12.2.1 Local site running Desktop Server.

Creating a new page. Adding a title and some text in the default Paragraph block.

CTRL (command) + Z = Undo works. CTRL (command) + SHIFT + D = Duplicates current line content. Nice to know about this shortcut! CTRL (command) + K = Open the Link control interface.

All 3 shortcuts worked on my Macbook Pro running OSX 12.2.1. From @tellthemachines above comment it sounds like a Windows issue.

ellatrix commented 1 year ago

Hi! Could you share what you see when you press S here?

https://www.toptal.com/developers/keycode

The most useful information would be under "Event dump"

youknowriad commented 1 year ago

I've just tried with an arabic keyboard on Mac OS, Cmd + s work properly for me but Ctrl + S doesn't (note the capital S) in other words, the keyboard shortcut is Cmd + s and not Cmd + Shift + s.