-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Controls] Fix timeslider focus outline and Shift-Tab behavior #230852
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Is this a workaround recommended by EUI? Could you provide some more background about why this implemenation path was selected?
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.
No workaround is currently recommended by EUI. This bug wasn't tracked, I just opened the issue after discovering it.
As I explained in the issue,
<EuiInputPopover>uses anonKeyDownhandler to triggerclosePopoverwhen the user tabs away from it. It does it by detecting if the Tab key was pressed, and ifdocument.activeElementis equal to the last tabbable item in the popover. It does not check to see whether the Shift key was also being held.The reason I'm doing it in this janky way is:
onKeyDownfunction to the input popover does not override the originalonKeyDown. It will always callclosePopoverif you hit Tab on the last tabbable element, and it doesn't send any arguments toclosePopover. An observable is the only way I could figure out to communicateevent.shiftKey === trueto theclosePopoverfunction.tabbable, an EUI dependency but not a Kibana dependency, so it's not available. The best we can do without adding a new dependency is to just hard disable closing the popover if the Shift key is used.<EuiInputPopover>just makes it impossible to Tab into the popover at allHappy to use a different workaround if EUI can recommend one, but this is what I got working
Uh oh!
There was an error while loading. Please reload this page.
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.
@Zacqary that's a very clever workaround but of course, we don't want it! I opened a PR to check for Shift key too: elastic/eui#8950
I also noticed that overall,
EuiInputPopoverkeyboard navigation is strange. We might need to look more deeply into this but for now the simple change ☝🏻 should at least get rid of the code on your side.The earliest we will be able to merge this PR is next week so don't hesitate to merge this as is.
cc @nreese @elastic/eui-team