base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

fix[popover]:Popover becomes unanchored when trigger is invisible

Open piyushzala158 opened this issue 6 months ago • 3 comments

Issue : https://github.com/mui/base-ui/issues/2121

Screenshot 2025-06-25 at 8 24 03 PM

piyushzala158 avatar Jun 25 '25 14:06 piyushzala158

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@2166

commit: f65b117

pkg-pr-new[bot] avatar Jun 25 '25 14:06 pkg-pr-new[bot]

Bundle size report

Bundle Parsed Size Gzip Size
@base-ui-components/react 🔺+289B(+0.10%) 🔺+99B(+0.10%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against f65b1174a465772041ea94b787a150ffb5b651fd

mui-bot avatar Jun 25 '25 14:06 mui-bot

Deploy Preview for base-ui ready!

Name Link
Latest commit f65b1174a465772041ea94b787a150ffb5b651fd
Latest deploy log https://app.netlify.com/projects/base-ui/deploys/685d581739dd870008027277
Deploy Preview https://deploy-preview-2166--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.

netlify[bot] avatar Jun 25 '25 14:06 netlify[bot]

This won't work in cases where an ancestor of the trigger becomes hidden. Making this work reliably in all cases is quite tricky and may have a negative impact on performance (especially when observing all ancestors). I'd recommend using the same approach as in #1907 - ignoring it. We can update the docs to say that the popup should be hidden manually whenever the trigger gets hidden. cc @atomiks

michaldudak avatar Jul 14 '25 08:07 michaldudak

This may be more of a feature or extension of the hide() middleware - if the autoUpdate function runs to recalculate the position when the trigger hides, then [data-anchor-hidden] would be applied to the positioner to hide it with CSS (visibility: hidden)

atomiks avatar Jul 14 '25 08:07 atomiks