spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: Scroll-jumping behavior in picker menus on hover

Open caseyisonit opened this issue 6 months ago • 3 comments

Code of conduct

  • [x] I agree to follow this project's code of conduct.

Impacted component(s)

sp-picker, sp-menu

Expected behavior

When hovering over an that contains overflow content, the scroll position should not shift on pointer enter.

Actual behavior

When activating the and hovering over the subsequent that contains generative model selections in Firefly Boards, users are experiencing a brief scroll-jumping behavior that can be disorienting.

Screenshots

https://github.com/user-attachments/assets/a8f7524f-b0d4-4883-b7a8-e5df0f510007

https://github.com/user-attachments/assets/7ba3ec82-08c7-45e0-921f-cc2cc11373ea

What browsers are you seeing the problem in?

Chrome

How can we reproduce this issue?

The issue can be reproduced in this Storybook story (see attached video): https://opensource.adobe.com/spectrum-web-components/storybook/index.html?path=/story/picker--custom

Anecdotally, this seems to happen more often when a menu item that would otherwise be hidden by overflow is selected.

Screen recording the same behavior in our app (Firefly Boards)

Sample code or abstract reproduction which illustrates the problem

No response

Severity

SEV 4

Logs taken while reproducing problem

No response

Would you like to track this issue in Jira?

  • [x] Yes, please tell me the ticket number!

caseyisonit avatar Jun 18 '25 17:06 caseyisonit

This request came from the Firefly team, Kyle Schaeffer. He should be included on the Jira ticket.

I have been able to reproduce this bug in our production documentation.

caseyisonit avatar Jun 18 '25 17:06 caseyisonit

This seems to be expected behaviour. In your first screen recording "Nebraska" is half way visible. Your cursor briefly hovers the menu item which triggers a focus event. That event scrolls "Nebraska" into view. See: https://github.com/adobe/spectrum-web-components/blob/main/packages/menu/src/MenuItem.ts#L749-L753

I can have another look and open a PR, if this is not expected

LucidityDesign avatar Jul 02 '25 09:07 LucidityDesign

SWC-1080. Let's review the comment left by @LucidityDesign as part of this work.

najikahalsema avatar Aug 18 '25 16:08 najikahalsema