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

[Select][base] Do not call onChange after initial render #37141

Merged
merged 2 commits into from May 9, 2023

Conversation

michaldudak
Copy link
Member

When the Select's value (controlled or uncontrolled) was set to null, the onChange event handler was called right after the initial render. This PR fixes this behavior and adds tests for various related cases.

Fixes #36783

@michaldudak michaldudak added bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels May 2, 2023
@mui-bot
Copy link

mui-bot commented May 2, 2023

Netlify deploy preview

https://deploy-preview-37141--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against beb7157

Signed-off-by: Albert Yu <albert@albertyu.co>
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Looks good ~ 👌

(I fixed a small typo)

@mj12albert mj12albert merged commit c023015 into mui:master May 9, 2023
18 checks passed
@michaldudak michaldudak deleted the iss/36783-select-onchange branch May 9, 2023 14:47
binh1298 pushed a commit to binh1298/material-ui that referenced this pull request May 17, 2023
Signed-off-by: Albert Yu <albert@albertyu.co>
Co-authored-by: Albert Yu <albert@albertyu.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Joy][Select] onChange callback fires without user interaction
3 participants