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

Cannot use Tab to move to columns #41014

Open
alexstine opened this issue May 12, 2022 · 5 comments
Open

Cannot use Tab to move to columns #41014

alexstine opened this issue May 12, 2022 · 5 comments
Labels
[Block] Table Affects the Table Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Comments

@alexstine
Copy link
Contributor

Steps:

  1. Insert a table block.
  2. Select Create Table button.
  3. Press Tab key to move to the second column.
  4. Notice how focus leaves the block and arrives at the sidebar.
  5. I expected focus to land in the second column and only reach the sidebar after the field labeled Caption.

This is related to writing flow. Just can't figure out how to adjust the logic here.

@alexstine alexstine added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Table Affects the Table Block [a11y] Keyboard & Focus labels May 12, 2022
@costdev
Copy link
Contributor

costdev commented May 12, 2022

Reproduction report

Environment

  • OS: Windows
  • Server: WSL2 (Ubuntu)
  • Browser: Google Chrome 101.0.4951.54
  • WordPress: 6.1-alpha-53344-src
  • Gutenberg version: with and without Gutenberg 13.1.0 active

Steps to reproduce.

  • Insert a table block.
  • Select Create Table button.
  • Press Tab key to move to the second column.
  • 🐞Notice how focus leaves the block and arrives at the sidebar.

Results

  • Issue reproduced. ✅

@t-hamano
Copy link
Contributor

t-hamano commented May 12, 2022

I developed a table block plugin with tab key navigation.
This is not an extension of RichText, but rather the logic to detect keyboard events within a block.
I am sure there are many improvements that could be made, but I hope this will be helpful.

@ajaydsouza
Copy link

Can this be prioritised for implementation? It's intuitive across when working with editors to use Tab to navigate. Right now it takes you completely out of the table.

@t-hamano
Copy link
Contributor

t-hamano commented Sep 9, 2024

As far as I can tell, when a block or an editable element within a block is selected, pressing the Tab key focuses the next focusable element, such as a tab in the block sidebar.

I'm afraid that if we were to introduce our own tab focus management for the Table block, it would conflict with the current behavior.

@ajaydsouza
Copy link

I agree on Tab going to the next focusable element. In the context of a table, the next focus of the existing cell is the cell to the right of it. So it would respect the focus behaviour.

I came here yesterday to this thread as I was editing a table, in the middle of a post, hit tab and the cursor jumped to the end of the post I was editing.

This is what is @alexstine proposed above as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants