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

[Discuss][RFC] - Add outside click onClose #5781

Closed
michaelolo24 opened this issue Apr 12, 2022 · 4 comments
Closed

[Discuss][RFC] - Add outside click onClose #5781

michaelolo24 opened this issue Apr 12, 2022 · 4 comments

Comments

@michaelolo24
Copy link

Background

There have been a few cases of bugs within Kibana where certain popovers or flyouts have stayed open when ideally they should have been closed on a click outside of the popover or flyout element. Most of these elements have either some form of an onClose or handleClose prop which allows use to manually trigger the close. This issue is an RFC to add a boolean flag or something similar to an closeOnOutsideClick boolean off to all popovers/modals. This could use the outsideClickDetector internally to the components, but could prove very useful in addressing a class of minor UI bugs such as these.

As an aside, when testing the outsideClickDetector https://elastic.github.io/eui/#/utilities/outside-click-detector, I was surprised to find that it also detects clicks on the button itself when enabled, which I would not have expected to be the default behavior

Screen.Recording.2022-04-12.at.9.22.19.AM.mov
@cchaos
Copy link
Contributor

cchaos commented Apr 12, 2022

Hey @michaelolo24, a prop already exists called outsideClickCloses.
Screen Shot 2022-04-12 at 09 42 48 AM

@cchaos cchaos closed this as completed Apr 12, 2022
@michaelolo24
Copy link
Author

Awesome, is this for popovers and modals? Couldn't find it in the docs

@cchaos
Copy link
Contributor

cchaos commented Apr 12, 2022

Popover's instinctively have his so long as you pass an onClose function. Modal's are the exception where we puposefully don't allow closing it by clicking outside as it says in out docs:
Screen Shot 2022-04-12 at 09 48 54 AM

@michaelolo24
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants