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

[material-ui][Autocomplete] Fix the options list being added to the DOM in freeSolo mode even when there are no options, causing style problems #41300

Merged
merged 11 commits into from Mar 7, 2024

Conversation

rakeshmusturi
Copy link
Contributor

@rakeshmusturi rakeshmusturi commented Feb 28, 2024

Fixes #40843

Adding condition to add popper to DOM only when the loading is happening or options are greater than 0

Adding condition to add popper to DOM only when the loading is happening or options are greater than 0
Bringing out the Popper container to a function and adding the popper to every condition, so that we can add a condition not to show popper when options are empty and loading is false
@mui-bot
Copy link

mui-bot commented Feb 28, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 8b1b546

@danilo-leal danilo-leal changed the title [material-ui][Autocomplete] Fix for Isuue 40843 : The options list is added to the DOM even when there are no options, causing style problems [material-ui][Autocomplete] Fix the options list being added to the DOM even when there are no options, causing style problems Feb 28, 2024
@danilo-leal danilo-leal added package: material-ui Specific to @mui/material component: autocomplete This is the name of the generic UI component, not the React module! labels Feb 28, 2024
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@rakeshmusturi Thanks for the pull request. The AutocompletePopper and AutocompletePaper components are shared among all three conditions. Can you consolidate them in one place for reuse? Also, please address the failing CI.

packages/mui-material/src/Autocomplete/Autocomplete.js Outdated Show resolved Hide resolved
packages/mui-material/src/Autocomplete/Autocomplete.js Outdated Show resolved Hide resolved
@ZeeshanTamboli ZeeshanTamboli added the bug 🐛 Something doesn't work label Mar 2, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Autocomplete] Fix the options list being added to the DOM even when there are no options, causing style problems [material-ui][Autocomplete] Fix the options list being added to the DOM even when there are no options in freeSolo mode, causing style problems Mar 7, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Autocomplete] Fix the options list being added to the DOM even when there are no options in freeSolo mode, causing style problems [material-ui][Autocomplete] Fix the options list being added to the DOM in freeSolo mode even when there are no options, causing style problems Mar 7, 2024
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@rakeshmusturi Thanks for the pull request. I've made the expected changes, and it looks good to me.

@ZeeshanTamboli ZeeshanTamboli merged commit 5fb8e19 into mui:master Mar 7, 2024
19 checks passed
cipherlogs pushed a commit to cipherlogs/material-ui that referenced this pull request Mar 8, 2024
…OM in `freeSolo` mode even when there are no options, causing style problems (mui#41300)

Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Mar 8, 2024
…OM in `freeSolo` mode even when there are no options, causing style problems (mui#41300)

Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
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: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
4 participants