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

Arrow key navigation in table block #14675

Closed
oandregal opened this issue Mar 28, 2019 · 4 comments · Fixed by #22105
Closed

Arrow key navigation in table block #14675

oandregal opened this issue Mar 28, 2019 · 4 comments · Fixed by #22105
Assignees
Labels
[Block] Table Affects the Table Block [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@oandregal
Copy link
Member

Spun off from #14462 (comment)

When the caret is at the table block:

  • the arrow down should move to the cell below instead of to the right cell
  • the arrow up key should move the caret to the cell above instead of the left cell
@oandregal oandregal added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Mar 28, 2019
@ellatrix
Copy link
Member

Currently, this roughly how the logic is:

  1. We look for the closest tabbable element in a given direction.
  2. We place the caret at the closet y position.

The problem is (1): DOM positioning may not be just vertical, but also horizontal, as is the case in a table block. Similar to #14462, we come to the same conclusion: we're looking for a visual position, but we're checking DOM position.

The solution is to find the closest element vertically that can receive the caret in the closest block. If there is no such element, the block should be selected.

Practically this probably means that we have to test if the browser can set a range at any x position with that fixed y position, perhaps skipping a few x positions at a time.

@ellatrix ellatrix added the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Mar 28, 2019
@ellatrix ellatrix added the [Block] Table Affects the Table Block label Aug 14, 2019
@tellthemachines
Copy link
Contributor

Noting here, as per the issue linked above, that currently it's impossible to move focus with the left and right arrow keys to a cell that's hidden from view. So if we have a wide table with horizontal scroll:

Screen Shot 2020-04-20 at 2 08 57 pm

with the cursor at the "basil" column I am not able, by using the right arrow, to navigate to the next column. If I scroll the hidden column into view, I am able to focus it normally.

@tellthemachines tellthemachines added [a11y] Keyboard & Focus [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later labels Apr 20, 2020
@ellatrix
Copy link
Member

ellatrix commented May 5, 2020

@tellthemachines could you open a new issue for that? It seems unrelated.

@ellatrix
Copy link
Member

ellatrix commented May 5, 2020

The up/down arrow issue should be fixed in #22105.

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 [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants