[8.17] Fix focus order in SOM table list view (#229876)#230059
Merged
kibanamachine merged 1 commit intoelastic:8.17from Jul 31, 2025
Merged
[8.17] Fix focus order in SOM table list view (#229876)#230059kibanamachine merged 1 commit intoelastic:8.17from
kibanamachine merged 1 commit intoelastic:8.17from
Conversation
fix elastic#154431 ## Summary This PR addresses the focus order issue in the Saved Objects table. There are several ways to address this issue: | Problem | Fix | |---------|-----| | Action buttons not immediately focusable after selection | Programmatically move focus to main action button (e.g., Delete) after selection | | Tab order does not match logical order | Ensure toolbar is before table in DOM, and focus moves as expected | | Actions are not easily accessible by keyboard | Add keyboard shortcuts for actions (optional) | | Screen reader users unaware of state change | Use ARIA live region to announce selection (optional) | I’ve taken the **pragmatic** approach and updated the focus management so that when a user selects an item, focus automatically moves to the Delete button, making keyboard navigation smoother. The changes in this PR include: - Updating the `onSelectionChanged` handler to focus the `Delete` button after selection, but only if it’s enabled. - Ensuring the `deleteButtonRef` is properly passed down and forwarded to the `EuiButton`. - Using the `setState` callback to guarantee the UI is updated before moving focus. With these changes, users can select items and immediately interact with the Delete or Export buttons without having to tab through the entire table. This should make the table more accessible and efficient to use. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [x] Changing the focus order from navigating through the saved objects table list directly to the delete button carries a risk that users might accidentally trigger deleting a saved object by mistake. The risk is low because the delete action has to be confirmed in a pop up modal before it triggers. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 731e97f)
5 tasks
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
|
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.
Backport
This will backport the following commits from
mainto8.17:Questions ?
Please refer to the Backport tool documentation