Skip to content

[tooltip][popover][preview card] Fix broken scale transition with detached triggers#3810

Merged
michaldudak merged 1 commit into
mui:masterfrom
michaldudak:popover-ending-style
Jan 22, 2026
Merged

[tooltip][popover][preview card] Fix broken scale transition with detached triggers#3810
michaldudak merged 1 commit into
mui:masterfrom
michaldudak:popover-ending-style

Conversation

@michaldudak

Copy link
Copy Markdown
Member

Fixed restoration of scale after it's forcibly set to 1 when measuring content dimensions in usePopupAutoresize.

Closes #3804

@michaldudak michaldudak added type: bug It doesn't behave as expected. component: tooltip Changes related to the tooltip component. component: popover Changes related to the popover component. component: preview card Changes related to the preview card component. labels Jan 21, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jan 21, 2026

Copy link
Copy Markdown
  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3810
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3810
    

commit: cf9c6bb

@mui-bot

mui-bot commented Jan 21, 2026

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) ▼-3B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@greptile-apps

greptile-apps Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixed a critical bug where the inline scale style was not properly restored after measuring popup content dimensions in usePopupAutoResize. When switching between detached triggers, the scale was left at 1, which broke CSS scale transitions during exit animations. The fix changes restoreMeasurementOverrides() to restoreMeasurementOverridesIncludingScale() on line 167, ensuring the scale property is restored along with position and transform. Tests were added for all three affected components (Tooltip, Popover, PreviewCard) to verify the scale style is properly cleared after trigger switches.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple one-line fix that correctly restores the scale property after measurement. The fix is well-targeted, addresses the root cause, and includes comprehensive test coverage across all affected components.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/utils/usePopupAutoResize.ts Fixed critical bug where scale style was not restored after measuring content, breaking CSS transitions when switching between detached triggers
packages/react/src/popover/root/PopoverRoot.detached-triggers.test.tsx Added test verifying scale style is properly cleared after switching triggers
packages/react/src/preview-card/root/PreviewCardRoot.detached-triggers.test.tsx Added test verifying scale style is properly cleared after switching triggers
packages/react/src/tooltip/root/TooltipRoot.detached-triggers.test.tsx Added test verifying scale style is properly cleared after switching triggers

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit cf9c6bb
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6970cad5d9355f00088b22e6
😎 Deploy Preview https://deploy-preview-3810--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍 👌

@michaldudak michaldudak merged commit 76910f6 into mui:master Jan 22, 2026
27 checks passed
@michaldudak michaldudak deleted the popover-ending-style branch January 22, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: popover Changes related to the popover component. component: preview card Changes related to the preview card component. component: tooltip Changes related to the tooltip component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[popover] data-ending-style not applied when exiting after switching between detached triggers

3 participants