Skip to content

Conversation

@Hamed-Ajaj
Copy link

Summary

Remove scale-based animations from Base UI Select styles to prevent popup
misalignment when opening or selecting a value.

This change significantly improves alignment consistency across styles
(Lyra, Nova, Vega, Maia, Mira), though a small horizontal translation issue
still exists in some cases.

What changed

  • Removed zoom-in / zoom-out animations from Base UI Select content styles
  • Kept fade and slide animations intact where applicable
  • No changes to positioning logic or layout structure

Motivation

Scale transforms applied to the positioned element caused the popup to visually
shift when its state changed (open/select). Removing these transforms fixes the
majority of alignment issues and stabilizes the popup position.

Known limitation

There is still a small horizontal translation discrepancy in some styles that
appears to originate from the Base UI Positioner alignment logic rather than
from styling alone.

I experimented with align, alignOffset, and alignItemWithTrigger, but none
fully resolved this without affecting expected behavior. For now, this PR
focuses on the main regression caused by scale transforms.

Notes

If there is a more idiomatic way to handle this alignment within Base UI’s
positioning system, I’d be happy to update the implementation based on
maintainer or community guidance.

Fixes #9053

@vercel
Copy link
Contributor

vercel bot commented Dec 14, 2025

@Hamed-Ajaj is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@Hamed-Ajaj
Copy link
Author

@shadcn

I removed the scale (zoom-in / zoom-out) animations from the Base UI Select
styles because they caused visible popup misalignment when opening or selecting
a value. This fixes most of the issue across styles.

There is still a small horizontal offset in some themes that seems to come from
Base UI’s Positioner alignment rather than styling alone. I tried align,
alignOffset, and alignItemWithTrigger, but couldn’t fully resolve it without
changing the expected placement behavior.

If you have a preferred or more idiomatic way to handle this within Base UI’s
positioning system, I’d appreciate the guidance.

@Hamed-Ajaj
Copy link
Author

I also tried fixing this in several ways by adjusting styles and Positioner
props (including alignment options and offsets), but none fully resolved the
issue across all styles.

From debugging in DevTools, it looks like the horizontal (left) positioning
calculated by Base UI’s Positioner is slightly off in some cases, which then
becomes visible depending on the style (padding, borders, font size, etc.).
That’s why the issue appears more clearly in certain themes.

Happy to adjust this further if there’s a recommended way to handle this within
the Positioner logic.

@shadcn shadcn added the area: roadmap This looks great. We'll add it to the roadmap, review and merge. label Dec 15, 2025
@joesanchezjr
Copy link

joesanchezjr commented Dec 15, 2025

thanks for taking a look at this! it looks like there is still an alignment issue when removing those animations - this is similar to the 4th screenshot in the original issue where I tried removing tw-animate-css - just wanted to add this for some visual context to your comments above
Screenshot 2025-12-15 at 10 35 46 AM

@Hamed-Ajaj
Copy link
Author

thanks @joesanchezjr ,

yup this was the problem that i couldn't fix it,

if you change also the style of the select for example mira lira or vega, the position of the popup will change

it's a weird problem.

@atomiks
Copy link

atomiks commented Dec 16, 2025

The problem relating to misalignment when using transform: scale() specifically will be fixed in Base UI in the next version (though it probably won't be released until next month): mui/base-ui#3532

@Hamed-Ajaj
Copy link
Author

thanks @atomiks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: roadmap This looks great. We'll add it to the roadmap, review and merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: base-ui select popover shifts on subsequent opens

4 participants