Repository navigation
[6.x] Name admin table rows in delete buttons and confirmations - #20633
Merged
Merged
Conversation
Each row's delete button is now named after the row, as its selection checkbox is, and deletion confirmations name the row or count the selected rows instead of asking "Are you sure?". Custom messages still take precedence. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d018-52fe-7115-873c-bc15563f0c5a Co-authored-by: Amp <amp@ampcode.com>
[ci skip] Amp-Thread-ID: https://ampcode.com/threads/T-01a1d018-52fe-7115-873c-bc15563f0c5a Co-authored-by: Amp <amp@ampcode.com>
Contributor
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Admin tables (
CraftCms\Cms\Ui\Nodes\Table,craft:admin-table) now name the row in its delete button and in deletion confirmations, and count the rows a bulk deletion takes.The row label is the first column's text, or the row's ID when that's empty. Messages a table or row passes in still take precedence.
Found while testing the native Webhooks plugin (craftcms/webhooks#108). The bulk "Set status" and "Actions" menus were also reported as missing from the accessibility tree, but that didn't reproduce: their items are exposed as buttons and work with the keyboard, following
craft-action-menu's Disclosure Navigation Menu pattern, so they're unchanged.Evidence
button "Delete item"×5. Bulk delete confirm: “Are you sure?”After:
button "Delete Field Showcase",button "Delete Home", …button "Delete Posts". Bulk delete confirm with two rows selected: “Are you sure you want to delete 2 items?”. Sections’ own message is unchanged: “Are you sure you want to delete “Pages” and all its entries?”names rows in their delete buttons and confirmations, and counts the rows a bulk deletion takesfails:Cannot find element with locator: getByRole('button', { name: 'Delete Beta' })After: it passes, with the rest of
AdminTableData.browser.test.ts(37 tests).statusActions()andbulkDeletable(): Tab reaches “Set status”, Enter focuses “Enabled”, ArrowDown/ArrowUp/Home/End move between items, Escape returns focus to “Set status”; the same for “Actions” → “Delete”.