[Overlay] Inline overlays with backdrops do not close on outside click
See original GitHub issueEnvironment
- Package version(s): 3.14.1
- Browser and OS versions: OSX/FF65
Steps to reproduce
- On Overlay docs page, open an overlay with
usePortal={false}
,hasBackdrop={true}
andcanOutsideCloseClick={true}
- Click anywhere on the page outside of the overlay’s container (overlay does not close)
- Click anywhere inside the overlay’s backdrop (overlay will close)
Actual behavior
An outside click somewhere on the document while an overlay is open does not close it.
Expected behavior
When an overlay is open with canOutsideClick={true}
, any click outside of the overlay content should close it.
Possible solution
Provided that this is not the desired behavior and by design, inline (non-portal) overlays should always bind a mousedown listener to document, regardless of whether or not they have a backdrop.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Close the overlay only if we click outside the modal content
I have a modal that is created using styled-components. It is wrapped with an overlay. When I click the overlay the modal closes...
Read more >CSS Overlay Techniques - Codrops
Lightweight overlays can be used for asking questions, obtaining input, introducing features, indicating progress, giving instructions, ...
Read more >ion-modal: Ionic Mobile App Custom Modal API Component
ion-modal is a dialog that appears on top of mobile app content, and must be dismissed before interaction resumes. Learn more about custom...
Read more >Backgrounds and overlays in SwiftUI - Swift by Sundell
Backgrounds and overlays in SwiftUI ... SwiftUI offers several different ways for us to create stacks of overlapping views that can be arranged ......
Read more >Positioning Overlay Content with CSS Grid
Not news to any web developer in 2021: CSS Grid is an incredibly powerful tool for creating complex, distinct two-dimensional modern web ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ah, good point 😃 I was thinking in a dialog-centric way
I’m going to close this as “by design”, but open to documentation changes which help explain the reasoning behind the interaction between these two props
As a quick aside:
This combo is the default for
<Popover>