-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Auto-focus ES|QL editor on mount #193800
Auto-focus ES|QL editor on mount #193800
Conversation
Currently, when the page loads, in order to start interacting with the ES|QL editor using keyboard navigation, you must: * Tab to the "Skip to main content" link * Follow that link * Tab through the tab and toolbar elements until you get to the editor * Press <end> or <ctrl-e> or down-down-down-down, depending on what's in the editor text box * Type my query This change auto-focuses the editor and moves the cursor to the end when the editor is mounted. The [ARIA Authoring Practices Guide (APG) for Developing a Keyboard Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/) says: > * Do not set initial focus when the page loads except in cases where: > ** The page offers a single, primary function that nearly all users employ immediately after page load. > ** Any given user is likely to use the page often. When using ES|QL in discover you almost always want to initially focus on the query, look at the results, and further refine the query.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
To update your PR or re-run it, just comment with: |
@smith thanx for the contribution! I am going to change your labels to also backport it in 8.x (with skip it only goes to 9.0) |
Pinging @elastic/kibana-esql (Team:ESQL) |
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!
## Summary Currently, when the page loads, in order to start interacting with the ES|QL editor using keyboard navigation, you must: * Tab to the "Skip to main content" link * Follow that link * Tab through the tab and toolbar elements until you get to the editor * Press END or CTRL-E or down-down-down-down, depending on what's in the editor text box * Type my query This change auto-focuses the editor and moves the cursor to the end when the editor is mounted. The [ARIA Authoring Practices Guide (APG) for Developing a Keyboard Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/) says: > * Do not set initial focus when the page loads except in cases where: > ** The page offers a single, primary function that nearly all users employ immediately after page load. > ** Any given user is likely to use the page often. When using ES|QL in discover you almost always want to initially focus on the query, look at the results, and further refine the query. ### Checklist - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) (cherry picked from commit 80f938e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [Auto-focus ES|QL editor on mount (#193800)](#193800) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan L Smith","email":"nathan.smith@elastic.co"},"sourceCommit":{"committedDate":"2024-09-24T06:29:46Z","message":"Auto-focus ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the page loads, in order to start interacting with the\r\nES|QL editor using keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main content\" link\r\n* Follow that link\r\n* Tab through the tab and toolbar elements until you get to the editor\r\n* Press END or CTRL-E or down-down-down-down, depending on what's in the\r\neditor text box\r\n* Type my query\r\n\r\nThis change auto-focuses the editor and moves the cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA Authoring Practices Guide (APG) for Developing a Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n> * Do not set initial focus when the page loads except in cases where:\r\n> ** The page offers a single, primary function that nearly all users\r\nemploy immediately after page load.\r\n> ** Any given user is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you almost always want to initially focus\r\non the query, look at the results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"Auto-focus ES|QL editor on mount","number":193800,"url":"https://github.com/elastic/kibana/pull/193800","mergeCommit":{"message":"Auto-focus ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the page loads, in order to start interacting with the\r\nES|QL editor using keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main content\" link\r\n* Follow that link\r\n* Tab through the tab and toolbar elements until you get to the editor\r\n* Press END or CTRL-E or down-down-down-down, depending on what's in the\r\neditor text box\r\n* Type my query\r\n\r\nThis change auto-focuses the editor and moves the cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA Authoring Practices Guide (APG) for Developing a Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n> * Do not set initial focus when the page loads except in cases where:\r\n> ** The page offers a single, primary function that nearly all users\r\nemploy immediately after page load.\r\n> ** Any given user is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you almost always want to initially focus\r\non the query, look at the results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193800","number":193800,"mergeCommit":{"message":"Auto-focus ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the page loads, in order to start interacting with the\r\nES|QL editor using keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main content\" link\r\n* Follow that link\r\n* Tab through the tab and toolbar elements until you get to the editor\r\n* Press END or CTRL-E or down-down-down-down, depending on what's in the\r\neditor text box\r\n* Type my query\r\n\r\nThis change auto-focuses the editor and moves the cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA Authoring Practices Guide (APG) for Developing a Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n> * Do not set initial focus when the page loads except in cases where:\r\n> ** The page offers a single, primary function that nearly all users\r\nemploy immediately after page load.\r\n> ** Any given user is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you almost always want to initially focus\r\non the query, look at the results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
Summary
Currently, when the page loads, in order to start interacting with the ES|QL editor using keyboard navigation, you must:
This change auto-focuses the editor and moves the cursor to the end when the editor is mounted.
The ARIA Authoring Practices Guide (APG) for Developing a Keyboard Interface says:
When using ES|QL in discover you almost always want to initially focus on the query, look at the results, and further refine the query.
Checklist