Skip to content

[Cases][a11y] Add manual focus to action buttons' actions#239504

Merged
janmonschke merged 3 commits intoelastic:mainfrom
janmonschke:cases/a11y-focus-fixes
Oct 17, 2025
Merged

[Cases][a11y] Add manual focus to action buttons' actions#239504
janmonschke merged 3 commits intoelastic:mainfrom
janmonschke:cases/a11y-focus-fixes

Conversation

@janmonschke
Copy link
Contributor

@janmonschke janmonschke commented Oct 17, 2025

Summary

Screenshot 2025-10-17 at 11 25 59

Many of the action button's actions open new flyouts or modals. In those cases, the focus trap isn't working correctly and we need to manually assign focus to the original action button after the performed action is done.

Fixes #195073
Fixes #195021
Fixes #195024

@janmonschke janmonschke self-assigned this Oct 17, 2025
@janmonschke janmonschke requested a review from a team as a code owner October 17, 2025 09:27
@janmonschke janmonschke added release_note:fix backport:version Backport to applied version labels Team:Cases Security Solution Cases team v9.2.0 labels Oct 17, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cases (Team:Cases)

Copy link
Contributor

@lgestc lgestc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good, just one improvement suggestion added 🚀

Comment on lines 64 to 71
returnFocus() {
if (focusButtonRef && 'current' in focusButtonRef && focusButtonRef.current) {
focusButtonRef.current.focus();
return false;
}
return true;
},
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could abstract into some kind of a shared function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I moved it into a hook: e79d245

@janmonschke janmonschke enabled auto-merge (squash) October 17, 2025 09:56
@janmonschke janmonschke merged commit 293a1c0 into elastic:main Oct 17, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.2

https://github.com/elastic/kibana/actions/runs/18592076490

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cases 1178 1179 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cases 1.4MB 1.4MB +1.1KB

cc @janmonschke

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 17, 2025
…9504)

## Summary

<img width="953" height="558" alt="Screenshot 2025-10-17 at 11 25 59"
src="https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86"
/>

Many of the action button's actions open new flyouts or modals. In those
cases, the focus trap isn't working correctly and we need to manually
assign focus to the original action button after the performed action is
done.

Fixes elastic#195073
Fixes elastic#195021
Fixes elastic#195024

(cherry picked from commit 293a1c0)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 17, 2025
) (#239548)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Cases][a11y] Add manual focus to action buttons' actions
(#239504)](#239504)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jan
Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2025-10-17T12:02:44Z","message":"[Cases][a11y]
Add manual focus to action buttons' actions (#239504)\n\n##
Summary\n\n<img width=\"953\" height=\"558\" alt=\"Screenshot 2025-10-17
at 11 25
59\"\nsrc=\"https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86\"\n/>\n\nMany
of the action button's actions open new flyouts or modals. In
those\ncases, the focus trap isn't working correctly and we need to
manually\nassign focus to the original action button after the performed
action is\ndone.\n\nFixes
https://github.com/elastic/kibana/issues/195073\nFixes
https://github.com/elastic/kibana/issues/195021\nFixes
https://github.com/elastic/kibana/issues/195024","sha":"293a1c0fe69667089bf1f7eac32f2f411b093968","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:version","Team:Cases","v9.2.0","v9.3.0"],"title":"[Cases][a11y]
Add manual focus to action buttons'
actions","number":239504,"url":"https://github.com/elastic/kibana/pull/239504","mergeCommit":{"message":"[Cases][a11y]
Add manual focus to action buttons' actions (#239504)\n\n##
Summary\n\n<img width=\"953\" height=\"558\" alt=\"Screenshot 2025-10-17
at 11 25
59\"\nsrc=\"https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86\"\n/>\n\nMany
of the action button's actions open new flyouts or modals. In
those\ncases, the focus trap isn't working correctly and we need to
manually\nassign focus to the original action button after the performed
action is\ndone.\n\nFixes
https://github.com/elastic/kibana/issues/195073\nFixes
https://github.com/elastic/kibana/issues/195021\nFixes
https://github.com/elastic/kibana/issues/195024","sha":"293a1c0fe69667089bf1f7eac32f2f411b093968"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239504","number":239504,"mergeCommit":{"message":"[Cases][a11y]
Add manual focus to action buttons' actions (#239504)\n\n##
Summary\n\n<img width=\"953\" height=\"558\" alt=\"Screenshot 2025-10-17
at 11 25
59\"\nsrc=\"https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86\"\n/>\n\nMany
of the action button's actions open new flyouts or modals. In
those\ncases, the focus trap isn't working correctly and we need to
manually\nassign focus to the original action button after the performed
action is\ndone.\n\nFixes
https://github.com/elastic/kibana/issues/195073\nFixes
https://github.com/elastic/kibana/issues/195021\nFixes
https://github.com/elastic/kibana/issues/195024","sha":"293a1c0fe69667089bf1f7eac32f2f411b093968"}}]}]
BACKPORT-->

Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Oct 23, 2025
…9504)

## Summary

<img width="953" height="558" alt="Screenshot 2025-10-17 at 11 25 59"
src="https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86"
/>

Many of the action button's actions open new flyouts or modals. In those
cases, the focus trap isn't working correctly and we need to manually
assign focus to the original action button after the performed action is
done.

Fixes elastic#195073
Fixes elastic#195021
Fixes elastic#195024
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
…9504)

## Summary

<img width="953" height="558" alt="Screenshot 2025-10-17 at 11 25 59"
src="https://github.com/user-attachments/assets/86915980-5ce1-434c-8484-b9d5fe26ec86"
/>

Many of the action button's actions open new flyouts or modals. In those
cases, the focus trap isn't working correctly and we need to manually
assign focus to the original action button after the performed action is
done.

Fixes elastic#195073
Fixes elastic#195021
Fixes elastic#195024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:Cases Security Solution Cases team v9.2.0 v9.3.0

4 participants