-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews Table - only output aria-label for media when item is clickable #73034
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
fbf88dc to
88aef93
Compare
|
Flaky tests detected in 88aef93. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19129329998
|
| export const Default = ( { perPageSizes = [ 10, 25, 50, 100 ] } ) => { | ||
| export const Default = ( { | ||
| perPageSizes = [ 10, 25, 50, 100 ], | ||
| hasClickableItems = true, |
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.
Hey, appreciate providing a test case, that's really helpful.
Given the impact this has, is it necessary to have this in the story? Perhaps just providing a diff for testing is enough? The stories should be something other devs and designers use to see what's possible with DataViews, and the hasClickableItems argument doesn't seem very useful. What do you think?
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.
Personally I prefer the options, though agree that the presentation in the storybook isn't great. Configuring DataViews without clickable rows is a valid configuration that devs and designers might be interested in, so maybe its useful to someone.
It might also more easily allow us to see bugs like this (and #71220, which was also a very similar issue) for configurations that we don't have in production.
I'll merge with the option, but if you feel strongly about it I don't mind removing it in a separate PR.
oandregal
left a comment
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.
Thanks! This logic is better.
I just left a comment about removing the storybook argument https://github.com/WordPress/gutenberg/pull/73034/files#r2498520933 but thought I'd pre-approve anyway.
andrewserong
left a comment
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.
LGTM, too!
What?
Fixes a small issue with the DataViews table layout observed in #72914 (comment).
When a table layout's item is not clickable, an aria-label saying "Click item" is still being rendered. This PR should fix the issue.
How?
isItemClickable( item )andonClickItem|renderItemLink, to more closely match the logic that the grid layout has.Testing Instructions
npm run storybook:devto open the storybook locallyTo reproduce the original bug you can also try checking out
trunk, change this line to return false:gutenberg/packages/dataviews/src/stories/dataviews.story.tsx
Line 103 in 0e79f37
Then observe that the images in the table have a 'Click item' aria label on a non-interactive wrapping element.