adobe / spectrum-web-components

Spectrum Web Components
https://opensource.adobe.com/spectrum-web-components/
Apache License 2.0
1.21k stars 192 forks source link

[Bug]: Modal overlays close unexpectedly when another overlay is added and when they're not an ancestor of a click event #4553

Open lehelen19 opened 2 weeks ago

lehelen19 commented 2 weeks ago

Code of conduct

Impacted component(s)

sp-overlay

Expected behavior

When we have a modal overlay open, adding another auto, modal, or page overlay should not close the initial overlay. [FIXED IN LATEST VERSION]

When a modal overlay is not an ancestor of a click event, such as when there's another modal overlay on top and there was a click outside of both overlays (on the underlay), neither overlay should close.

Actual behavior

When we have a modal overlay open, adding another overlay will close the initial overlay.

When a modal overlay is not an ancestor of a click event, it will close.

See https://github.com/adobe/spectrum-web-components/discussions/4463.

Screenshots

No response

What browsers are you seeing the problem in?

Firefox, Chrome, Safari, Microsoft Edge

How can we reproduce this issue?

  1. Go to https://studio.webcomponents.dev/edit/kdwz4Jzt35XsLdzn5Id1/src/?p=stories
  2. Click on button to open first dialog
  3. Click on button to open second dialog
  4. Click on the "X" button
  5. Observe both dialogs closing

Expected: The initial modal dialog does not close.

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response