-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmd [arrow] commands do not function as expected #5805
Comments
Question:
Should a single block (e.g. a paragraph) define an arrow-behavior context? Currently, a single paragraph in Gutenberg is equivalent to a textarea and communicated as such to assistive technologies. Thus, I'd expect arrow commands to work within a single block. Or, should the whole post be the context for the arrows commands? |
Also, worth considering the equivalent arrow commands on Windows. |
@mcsf I believe many of these work a lot better now, can you check on the status and see if anything remains to be improved and how pressing it is? |
Somewhat related: #4004
I don't think this was ever explicitly implemented in WritingFlow, so what we're seeing ends up being a combination of native behaviour (e.g. jumping to the start or end of a block's text field) with editor behaviour (navigating between blocks when the caret sits at a block boundary). It could be implemented, but this would be a new task, not a fix. |
I've noticed a lot of these interactions being better (moving to the end / beginning of the block, etc), hence the question. It'd be nice to validate a few more and look at implementing missing ones if it can be done reliably across browsers. |
I tested using the demo post with WordPress 4.9.8 and Gutenberg 4.3 using Firefox 63.0.1, Chrome 70.0.3538.77, and Safari 12.0 on macOS 10.13.6 and found the following to be generally true. When the caret is not at a block boundary:
If the caret is sitting at a block boundary:
Assuming block boundaries are defined as:
Exceptions:
This is what I found after auditing the demo post which contains the following blocks:
|
I propose closing this issue after creating separate issues for the following exceptions noted above:
@mtias @mcsf does that sound good to you? Or do all blocks need to be audited? (list of blocks) |
On Windows you can navigate by word with Ctrl + Arrow keys. In Gutenberg this doesn't work (although works in case of selection by word with Ctrl + Shift + Arrow keys). To be honest, this is SO basic and SO needed that I'm surprised this was not marked as critical and the editor was released with this bug. You basically cannot edit text with keyboard because anyone who has any speed in text writing uses this all the time. |
@waterplea thanks for your feedback. I'd totally agree testing on Windows would need some more care. Also totally agree basic operations like navigating and selecting text with the keyboard should work flawlessly and should be tested in a solid way. The specific bug you've mentioned has been recently reported in #14170 and fixed in #14184. The fix will be included in the next release. |
Can we get a status update? |
@ellatrix I've been thinking that for the ⌘ ↑ case, the first press works fine (moves to the top of the current block) but we should make it so the subsequent press moves to the top of the previous block. What do you think? |
@mtias Maybe. I think that behaviour may make more sense for Alt+Arrow? |
Would command+arrow then move to the start of the document? I think the issue now is that once on a block boundary, command+Arrow feels erratic. |
Yes, Cmd+Arrow should move to the start of the document then, Alt+Arrow block by block. |
I think this works mostly correctly now: Cmd + horizontal arrow sets the caret at the start or end of the line. But it won't let you move the caret to the first or last block. One idea could be to make it similar to how Cmd+A works:
I could enhance Cmd + arrow similarly so it first move to the start of the input, then the first block from the nested blocks, then the first block of the parent nested blocks, and so on. But it seems the main issue is fixed here, it depends what "beginning of your content" means (in the post and site editor). |
Issue Overview
In macOS, ⌘ [arrow] commands have well-defined meanings, in a text-editing context.
In Gutenberg, these commands inconsistently navigate your caret between blocks.
Expected Behavior
macOS default behavior.
The text was updated successfully, but these errors were encountered: