-
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
[Lens] Prevent KQL Popovers From Stacking #118258
[Lens] Prevent KQL Popovers From Stacking #118258
Conversation
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
…tate/kibana into 105518/filter-popovers-can-stack
@flash1293 good catch. I've updated the PR to restore that behavior. |
Sorry, missed this during first review - to make it easy to use this via keyboard only, the focus should jump back to the "Add filter" button if the user presses enter in the KQL field in the popover: However, on this PR it's jumping to the close button instead: I'm not 100% sure why this happens - the logic to put the focus back to the last button is handled automatically by the EuiPopover - it stores a reference to the last focused element on opening, then on closing it tries to focus it again. Maybe it's because the newly introduced effect takes an additional render cycle to get the "open" state to the filter popover? https://github.com/elastic/kibana/pull/118258/files#diff-2d0f89c22addaee8aa9d430ad3ae303df53874d506b65f1c820371c727b17cb1R182 On your PR the user presses the "Add filter" button, it adds the filter to the state, renders, sets the "activeFilterId" via the new effect hook, renders, then sets the actual popover open state in |
Good job with this PR, these things are really tricky! Apart from Joe's comment, there's two more issues:
|
@elasticmachine merge upstream |
…tate/kibana into 105518/filter-popovers-can-stack
For the record, @flash1293 and I found that the focus bug is present on
Sure! Would you recommend I do that as part of this PR, or shall I create a separate issue?
I see what you mean. I'll have a look. |
@mbondyra it looks like the escape key behavior should be handled by EUI (see this PR). However, for some reason it isn't working, so I provided a stop-gap solution that you can review. This makes me wonder if we've found two EUI bugs. Edit: it looks like they're working on a major version bump right now #117242. Maybe this will resolve something... |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
As you prefer! I'm gonna approve this now and ask me for rereview in case if you choose to continue in this PR :) The 'focus to close button' bug happens on 7.16 too so if you choose not to fix it here, please create an issue 🙏🏼 |
Summary
Fixes #105518 .
Does this by using the parent
FilterList
component to manage open/close popover state. This allows us to make sure that only one can be open at a time.Screen.Recording.2021-11-10.at.3.07.31.PM.mov