Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[menu] Positioner is repositioned when navigating items #1432

Open
aarongarciah opened this issue Feb 7, 2025 · 2 comments
Open

[menu] Positioner is repositioned when navigating items #1432

aarongarciah opened this issue Feb 7, 2025 · 2 comments
Labels
component: menu This is the name of the generic UI component, not the React module! has workaround

Comments

@aarongarciah
Copy link
Member

aarongarciah commented Feb 7, 2025

Bug report

Current behavior

When the Popup part of the Menu is partly outside the viewport, if you navigate the options via ⬆️ ⬇️ keys, the positioner is repositioned. See attached video.

Kapture.2025-02-07.at.14.32.42.mp4

Expected behavior

The Popup should stay in the same place.

Reproducible example

https://codesandbox.io/p/sandbox/mns5dn?file=/src/App.tsx

Base UI version

1.0.0-alpha.6

@aarongarciah aarongarciah added component: menu This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 7, 2025
@atomiks
Copy link
Contributor

atomiks commented Feb 17, 2025

The interal scroll logic call .scrollIntoView({ block: 'nearest' }) causes this. Not sure if it matters given the CSS of the popup should have max-width: var(--available-width) which fixes both the layout overflow issue and this one.

@atomiks atomiks added has workaround and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 17, 2025
@aarongarciah
Copy link
Member Author

This looks like an edge case, yeah. Even if the demos don't need them, I think adding some of the CSS properties like max-width: var(--available-width) is worth it.

@oliviertassinari oliviertassinari changed the title [Menu] Positioner is repositioned when navigating items [menu] Positioner is repositioned when navigating items Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! has workaround
Projects
None yet
Development

No branches or pull requests

2 participants