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

Hoisted dropdowns incorrectly positioned inside container-type elements in Chrome 129 #2185

Open
BuddyLReno opened this issue Sep 24, 2024 · 3 comments
Labels
bug Things that aren't working right in the library.

Comments

@BuddyLReno
Copy link

Describe the bug

When placing a hoisted dropdown inside an element with container-type set to size or inline-size, the position of the menu is incorrectly calculated. Setting the property to normal or removing entirely fixes the issue.

This specifically started in Chrome 129, possibly due to changes that were rolled out affecting CSS positioning and size calculations: https://developer.chrome.com/release-notes/129#css

This issue does not occur in Firefox or Safari. Can use the demo in the codepen provided below for verification.

To Reproduce

Add a hoisted dropdown to an element that has container-type: size or container-type: inline-size.

Demo

I've reproduced it in codepen, featuring a broken version with container-type set to inline-size and another one inside that's working set to container-type: normal.
https://codepen.io/BuddyLReno/pen/eYqYaGY?editors=1100

Screenshots

image

Browser / OS

  • OS: Mac and Windows
  • Browser: Chrome
  • Browser version: 129

Additional information

Verified on my windows machine the issue was not occurring on Chrome 128, updated to 129 and the issue began occurring with the same codepen.

@BuddyLReno BuddyLReno added the bug Things that aren't working right in the library. label Sep 24, 2024
@schilchSICKAG
Copy link
Contributor

We also ran into this issue in our "fork" of Shoelace, Synergy. A quick fix is setting positon: relative; z-index: 1 on the element that is acting as the container. See synergy-design-system/synergy-design-system#612 for another reference.

@BuddyLReno
Copy link
Author

@schilchSICKAG Unfortunately, that fix doesn't work in this case. If you view the codepen, I've updated it to add an example with the proposed fix, but the dropdowns are still misplaced. https://codepen.io/BuddyLReno/pen/eYqYaGY?editors=1100

@KonnorRogers
Copy link
Collaborator

Yea this isn't a stacking context issue, this is a boundary calculation issue most likely from floating UI; I'm gonna try today to upgrade floating UI today if that doesn't work, I'll try to make a minimal repro for floating UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

3 participants