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]: sp-overlay needs 2 clicks to close on Windows with notImmediatelyClosable set #4530

Open shinjanxp opened 1 month ago

shinjanxp commented 1 month ago

Code of conduct

Impacted component(s)

Overlay

Expected behavior

When using the sp-overlay imperative API to create a custom right-click menu, the notImmediatelyClosable prop is supposed to prevent a pointerup event from closing the Overlay. However, any subsequent left click should close the overlay.

Actual behavior

This is working fine on Mac, but, on Windows, the pointerup event is firing before the contextmenu event that is used to trigger the menu open. So it needs 2 clicks to close the custom menu.

Screenshots

https://github.com/adobe/spectrum-web-components/assets/7351026/9fa5f923-fc81-4d58-b9c9-41f3f8ac77c6

What browsers are you seeing the problem in?

Chrome, Microsoft Edge

How can we reproduce this issue?

  1. Go to https://opensource.adobe.com/spectrum-web-components/components/imperative-api/#using-a-virtual-trigger on a Windows system
  2. Right click in the bounded rectangle to open custom context menu
  3. Left click anywhere outside the menu
  4. Observe that first click does not close the menu
  5. Click again and observe that menu closes

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response