question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Overlay] Inline overlays with backdrops do not close on outside click

See original GitHub issue

Environment

  • Package version(s): 3.14.1
  • Browser and OS versions: OSX/FF65

Steps to reproduce

  1. On Overlay docs page, open an overlay with usePortal={false}, hasBackdrop={true} and canOutsideCloseClick={true}
  2. Click anywhere on the page outside of the overlay’s container (overlay does not close)
  3. 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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
adidahiyacommented, Mar 12, 2019

This combo is the default for <Popover>

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

0reactions
jaamisoncommented, Mar 12, 2019

As a quick aside:

This combination of canOutsideClickClose={true} hasBackdrop={false} is provided as an API for very special use cases,

This combo is the default for <Popover>

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found