Skip to content

Commit c57f436

Browse files
[9.2] [SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications (#237999) (#238411)
# Backport This will backport the following commits from `main` to `9.2`: - [[SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications (#237999)](#237999) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ángeles Martínez Barrio","email":"angeles.martinezbarrio@elastic.co"},"sourceCommit":{"committedDate":"2025-10-10T09:46:52Z","message":"[SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications (#237999)\n\nCloses https://github.com/elastic/kibana/issues/237039\n\n## Summary\n\nAdded `autofocus` attribute to be able to set focus on the button on its\ninitial render. That way, after saving, users will get the toast\nnotification and focus will be set on \"Reload page\" button without\ndisrupting keyboard navigation.\n\nReplicated and tested this for two other \"Reload page\" buttons on toast\nnotifications.\n\n### Testing\n\n\nhttps://github.com/user-attachments/assets/1bd90992-1419-425b-9d38-8e635bc1e7c7","sha":"8cbaf7912b89795ce4d337bdad4a3d7322828847","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:SharedUX","backport:version","a11y","v9.2.0","v9.1.5","v9.3.0"],"title":"[SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications","number":237999,"url":"https://github.com/elastic/kibana/pull/237999","mergeCommit":{"message":"[SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications (#237999)\n\nCloses https://github.com/elastic/kibana/issues/237039\n\n## Summary\n\nAdded `autofocus` attribute to be able to set focus on the button on its\ninitial render. That way, after saving, users will get the toast\nnotification and focus will be set on \"Reload page\" button without\ndisrupting keyboard navigation.\n\nReplicated and tested this for two other \"Reload page\" buttons on toast\nnotifications.\n\n### Testing\n\n\nhttps://github.com/user-attachments/assets/1bd90992-1419-425b-9d38-8e635bc1e7c7","sha":"8cbaf7912b89795ce4d337bdad4a3d7322828847"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","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/237999","number":237999,"mergeCommit":{"message":"[SharedUX][A11y] Fix keyboard focus on Reload page button for toast notifications (#237999)\n\nCloses https://github.com/elastic/kibana/issues/237039\n\n## Summary\n\nAdded `autofocus` attribute to be able to set focus on the button on its\ninitial render. That way, after saving, users will get the toast\nnotification and focus will be set on \"Reload page\" button without\ndisrupting keyboard navigation.\n\nReplicated and tested this for two other \"Reload page\" buttons on toast\nnotifications.\n\n### Testing\n\n\nhttps://github.com/user-attachments/assets/1bd90992-1419-425b-9d38-8e635bc1e7c7","sha":"8cbaf7912b89795ce4d337bdad4a3d7322828847"}}]}] BACKPORT--> Co-authored-by: Ángeles Martínez Barrio <angeles.martinezbarrio@elastic.co>
1 parent 3b2655a commit c57f436

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/packages/chrome/browser-internal/src/handle_system_colormode_change.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export async function handleSystemColorModeChange({
121121
size="s"
122122
onClick={() => window.location.reload()}
123123
data-test-subj="windowReloadButton"
124+
autoFocus
124125
>
125126
{i18n.translate(
126127
'core.ui.chrome.appearanceChange.requiresPageReloadButtonLabel',

src/platform/packages/shared/kbn-management/settings/components/form/reload_page_toast.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const reloadPageToast = (startDeps: StartDeps): ToastInput => {
4343
size="s"
4444
onClick={() => window.location.reload()}
4545
data-test-subj={DATA_TEST_SUBJ_PAGE_RELOAD_BUTTON}
46+
autoFocus
4647
>
4748
{i18n.translate('management.settings.form.requiresPageReloadToastButtonLabel', {
4849
defaultMessage: 'Reload page',

src/platform/packages/shared/kbn-user-profile-components/src/hooks/use_update_user_profile.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const useUpdateUserProfile = ({
8484
size="s"
8585
onClick={() => window.location.reload()}
8686
data-test-subj="windowReloadButton"
87+
autoFocus
8788
>
8889
{i18n.translate(
8990
'userProfileComponents.updateUserProfile.notification.requiresPageReloadButtonLabel',

0 commit comments

Comments
 (0)