Skip to content

TableView: space key on link within cell scrolls the TableView down a page #2599

@majornista

Description

@majornista

🐛 Bug Report

Within TableView, pressing the space key on a link within a cell scrolls the TableView down a page. After scrolling the row containing the link out of view, the keyboard focus gets shifted to the TableView container element itself, yet pressing space again to scroll down does nothing.

This behavior can be reproduced using the TableView async loading example in Storybook.

🤔 Expected Behavior

The Space key event handler within TableView should stopPropagation to prevent the browser's default behavior, to scroll whichever scrolling region comes first or the document body.

Links are typically activated using the Enter key, so I don't necessarily expect Space to activate the link. Depending on the selection mode, pressing Space with focus on a link within a cell should either select the row or do nothing.

😯 Current Behavior

Pressing the space key on a link within a cell scrolls the TableView down a page. After scrolling the row containing the link out of view, the keyboard focus gets shifted to the TableView container element itself, yet pressing space again to scroll down does nothing.

💁 Possible Solution

preventDefault but don't stopPropagation of keyboard event using space key on link.

🔦 Context

This bug was identified during and accessibility review for a control using the Inventory component within quarry.

🌍 Your Environment

Software Version(s)
react-spectrum @react-spectrum/table@3.0.1
Browser Chrome 96.0.4664.55 (Official Build) (x86_64)
Operating System macOS 11.6 (20G165)

🧢 Your Company/Team

Adobe/Accessibility

🕷 Tracking Issue (optional)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions