adobe / spectrum-web-components

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

[feat]: API for persisting Overlay content across parent element scrolls #3990

Open siddhantAdobe opened 6 months ago

siddhantAdobe commented 6 months ago

Code of conduct

Impacted component(s)

, ### Expected behavior When scrolling the parent div, the `sp-popover` or `sp-tooltip` should not get closes automatically. ### Actual behavior When scrolling the parent div, the `sp-popover` or `sp-tooltip` get closed automatically. ### Screenshots https://github.com/adobe/spectrum-web-components/assets/158441241/1f2f87d1-9b8e-4049-b2e7-d022dc27d381 ### What browsers are you seeing the problem in? Firefox, Chrome, Safari, Microsoft Edge ### How can we reproduce this issue? 1. Go to '[new.express.adobe.com](https://new.express.adobe.com)' 2. Create a video project with timeline. 3. Increase the scene width using trim handles and observe the timecode popover over the trim handle 4. Popover gets closed as soon as the scrolling start. 5. Same issue is observed when moving the trackpin near the edge and timeline gets scrolled. ### Sample code that illustrates the problem https://studio.webcomponents.dev/edit/KeJx04t6aDK9hORsw7yP/src/index.ts?p=stories ### Logs taken while reproducing problem _No response_
Westbrook commented 5 months ago

This is currently working as expected. I've updated the description to outline that this is a feature request. Would you happen to have any desires or recommendation as to how an API in this are might be shaped?

siddhantAdobe commented 5 months ago

In the sample code added, you can check that when scrolling trigger during movement of trackpin div near right edge, the popover gets closed. But we want the popover to stay when scrolling is happening. What we desire is something like if there can be an attribute to set if we want to close the overlay on scroll or not.

https://github.com/adobe/spectrum-web-components/assets/158441241/0d022df4-f23b-42e3-b269-549c739c5824

Westbrook commented 5 months ago

This is outcomes, I'm wondering what you think about an actual alteration of the API to support something like this.

In that way, these questions come to mind:

siddhantAdobe commented 4 months ago

@Westbrook