Skip to content
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

Arrowkeys should navigate between blocks #520

Closed
jasmussen opened this issue Apr 27, 2017 · 19 comments
Closed

Arrowkeys should navigate between blocks #520

jasmussen opened this issue Apr 27, 2017 · 19 comments
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Priority] High Used to indicate top priority items that need quick attention [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@jasmussen
Copy link
Contributor

As in https://wordpress.github.io/gutenberg/tinymce-per-block/, try to:

  • put cursor inside a text block
  • arrow key to the end of it
  • arrow key further downwards

Expected result is to arrow key into the next block.

@jasmussen jasmussen added the [Type] Bug An existing feature does not function as intended label Apr 27, 2017
@jasmussen jasmussen added this to the Prototype Parity milestone Apr 27, 2017
@ellatrix
Copy link
Member

I think this is not implemented yet, rather than a bug.

@ellatrix
Copy link
Member

ellatrix commented Apr 27, 2017

Happy to look into this one.

@ellatrix ellatrix self-assigned this Apr 27, 2017
@jasmussen jasmussen added [Type] Task Issues or PRs that have been broken down into an individual action to take and removed [Type] Bug An existing feature does not function as intended labels Apr 27, 2017
@jasmussen
Copy link
Contributor Author

Great point. Relabelled :)

@mtias mtias added the [Priority] High Used to indicate top priority items that need quick attention label Apr 27, 2017
@BE-Webdesign
Copy link
Contributor

There is potential for overlap with #515. It would be nice to have a consistent way to handle arrow navigation. Ping me when the PR is ready.

@ellatrix
Copy link
Member

What would you expect once you hit the boundary? Caret at the same place vertically in the next block?

@ellatrix
Copy link
Member

I see that in the per-block prototype it goes first fully to the end, then to the start of the next block.

@ellatrix ellatrix added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Apr 28, 2017
@ellatrix
Copy link
Member

@afercia Would be great to hear you thoughts on this one as well. :)

@afercia
Copy link
Contributor

afercia commented Apr 28, 2017

@iseulde I've seen in some of the prototypes it was possible to go through all the blocks just using the arrow keys. I'd would expect the same in the plugin, where navigating content moving the cursor with the arrow keys should work exactly like in a textarea 🙂 Whether you use right/down/left/up, home, end, etc. there should be the ability to navigate block as a whole.

@ellatrix
Copy link
Member

Yeah, this is not a single textarea though, each blocks is a separate textarea. How should it work if all blocks are seen as separate ones? If it should work as one area, it should probably be one content editable area.

@afercia
Copy link
Contributor

afercia commented Apr 28, 2017

How should it work if all blocks are seen as separate ones?

I think everyone, not only assistive technologies users, would have troubles to understand why what looks like a unique post content can't be navigated with arrows like everyone is used to do when typing.

@ellatrix
Copy link
Member

Same here. But it sounds like we should think of it as separate pieces, similar to text areas on a settings page.

@afercia
Copy link
Contributor

afercia commented Apr 28, 2017

I'm not the best person to dive into technical choices here. As a user, I just know that the interface is making me a promise, and the promise is not fulfilled 🙂
(I also remember vaguely some discussion about how to "select all" the post content)

@afercia
Copy link
Contributor

afercia commented Apr 29, 2017

A quick comparison between what was available for testing till now (the prototypes) and the plugin as of today (April 29th). Comparing basic text navigation actions that should work out of the box. Testing on Chrome/Mac, for the Home/End keys I'm using:

Home: Cmd + Up Arrow
End:  Cmd + Down Arrow
https://wordpress.github.io/gutenberg/
arrowing through all content: yes
Home/End through all content: yes (can't test what happens when the last block is non editable, e.g. an embed)
Select through blocks:        yes
Select all (Cmd + A):         yes

https://wordpress.github.io/gutenberg/tinymce-per-block/
arrowing through all content: yes
Home/End through all content: no (constrained within blocks)
Select through blocks:        no
Select all (Cmd + A):         no (constrained within blocks)

https://wordpress.github.io/gutenberg/tinymce-single/
arrowing through all content: yes
Home/End through all content: partial (Home works, End does nothing if the last block is non editable)
Select through blocks:        yes
Select all (Cmd + A):         no

Plugin as of April 29th
arrowing through all content: no (constrained within blocks)
Home/End through all content: no (constrained within blocks)
Select through blocks:        no
Select all (Cmd + A):         no (constrained within blocks)

For more advanced text interactions, see:
Simple text interactions #179

@afercia
Copy link
Contributor

afercia commented Apr 29, 2017

See also #3 and #62

@ellatrix
Copy link
Member

ellatrix commented May 1, 2017

Working on this one right now.

@ellatrix
Copy link
Member

ellatrix commented May 18, 2017

@matias If we decide to only handle tabs, not arrow keys, then this already works. Note that sometimes the focus goes to the buttons first e.g. for images. See #838 to add styling so you can follow where the focus is.

@jasmussen
Copy link
Contributor Author

Splitting and merging text blocks is working well. The multi paragraph text block is working well. I expect the freeform block will be nice to have as well. As such, let's close this, and go with tabs to navigate between blocks, the pattern to emulate being "desktop publishing for the web". This will be like when you tab from the title field into the text field in the current editor (and the Gutenberg equivalent would be tabbing from the title field into the freeform block).

@ellatrix
Copy link
Member

I agree here. If we don't allow cross block selection at this time, it doesn't really make sense to add arrow key navigation (in my opinion).

@afercia
Copy link
Contributor

afercia commented May 23, 2017

I'd agree the two things should go together. Also, the "Select all" issue. I think the accessibility issue still stands, but let's move on 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Priority] High Used to indicate top priority items that need quick attention [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

5 participants