Skip to content
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

[8.x] Auto-focus ES|QL editor on mount (#193800) #193818

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## 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)
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
esql 171.4KB 171.5KB +53.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @smith

@kibanamachine kibanamachine merged commit 6b9fbf8 into elastic:8.x Sep 24, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants