Skip to content

[select] Fix re-render warning in Positioner on fallback #2089

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

Merged
merged 2 commits into from
Jun 12, 2025

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Jun 10, 2025

The set-state-in-render pattern only works if the state is local to the component, otherwise it needs to use an effect now that it's in the store.

To reproduce the warning before, just open the select close to the edge of the viewport so it enters fallback mode

Copy link

pkg-pr-new bot commented Jun 10, 2025

Open in StackBlitz

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

commit: c76aa92

@mui-bot
Copy link

mui-bot commented Jun 10, 2025

Bundle size report

Total Size Change: 🔺+44B(0.00%) - Total Gzip Change: 🔺+16B(0.00%)
Files: 41 total (0 added, 0 removed, 2 changed)

Show details for 41 more bundles

@base-ui-components/reactparsed: 🔺+22B(+0.01%) gzip: 🔺+8B(+0.01%)
@base-ui-components/react/selectparsed: 🔺+22B(+0.02%) gzip: 🔺+8B(+0.02%)
@base-ui-components/react/accordionparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/alert-dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/avatarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkbox-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/collapsibleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/context-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/direction-providerparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldsetparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/formparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/inputparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menubarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/merge-propsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/meterparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/navigation-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/number-fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/popoverparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/preview-cardparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/progressparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radioparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radio-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/scroll-areaparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/separatorparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/sliderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/switchparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tabsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toastparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggle-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toolbarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tooltipparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-no-ssrparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-use-media-queryparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/use-renderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/utilsparsed: 0B(0.00%) gzip: 0B(0.00%)
Base UI checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against c76aa92

@atomiks atomiks marked this pull request as ready for review June 10, 2025 09:01
Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f93754e
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6847f3fb03b7e50008ce9a4d
😎 Deploy Preview https://deploy-preview-2089--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.

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit c76aa92
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6847f4766f383000084c8675
😎 Deploy Preview https://deploy-preview-2089--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.

@atomiks atomiks requested a review from romgrk June 10, 2025 09:09
@mj12albert
Copy link
Member

By fallback mode you mean item-not-aligned-to-trigger like this right? I couldn't reproduce a warning 🤔 @atomiks

Screenshot 2025-06-12 at 9 37 52 AM

@atomiks
Copy link
Contributor Author

atomiks commented Jun 12, 2025

@mj12albert yeah that's right, but I think it only happens in dev mode

@atomiks atomiks merged commit 7ca8cd9 into mui:master Jun 12, 2025
22 checks passed
@atomiks atomiks deleted the fix/select-positioner-warning branch June 12, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants