-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix keyboard interaction bug for the rows of the Table component #2985
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f4ff8f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +152 B (+0.02%) Total Size: 708 kB
ℹ️ View Unchanged
|
1bfc51a
to
f4ff8f6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2985 +/- ##
=======================================
Coverage 87.63% 87.64%
=======================================
Files 229 229
Lines 13082 13091 +9
Branches 1764 1767 +3
=======================================
+ Hits 11464 11473 +9
Misses 1561 1561
Partials 57 57
🚀 New features to boost your workflow:
|
const onClick = vi.fn(); | ||
render(<TableRow onClick={onClick}>{children}</TableRow>); | ||
const rowEl = screen.getByRole('row'); | ||
|
||
rowEl.focus(); | ||
await userEvent.type(rowEl, '{enter}'); | ||
await userEvent.type(rowEl, ' '); | ||
await userEvent.keyboard('{Enter}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the key from the test matrix above.
Addresses DSYS-977
Description
There are interactive table rows that receive focus when navigating the page using a keyboard. However, it cannot be
activated using Enter or Space.
As such, keyboard users may not be able to operate those interactive elements.
Approach and changes
Add a keydown event handler than triggers the onClickcallback when a row receives a Enter or Space key event.
Definition of done