-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[select] Fixed dropdown resizing bug #47137
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
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy previewhttps://deploy-preview-47137--material-ui.netlify.app/ Bundle size report
|
PR Title[mui-material][Select] Fixed dropdown resizing bug #47137 PR DescriptionSummaryThis PR fixes a bug that caused the Select component drop-down width to not match trigger width on window resize. (#47035 ) by listening to the window resize and handling the width of the component using Files changed:
Problem SolvedThe issue was successfully solved when tested in the playground. |
fb2529b to
5a72506
Compare
|
|
||
| const win = ownerDocument(displayNode).defaultView; | ||
| if (win) { | ||
| win.addEventListener('resize', handleResize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siddarthan007 Thanks for the PR ~ here it would be good to use ResizeObserver if supported, see:
- [select] Dropdown width does not match trigger width on window resize #47035 (comment)
material-ui/packages/mui-material/src/Tabs/Tabs.js
Lines 680 to 689 in bfd10b6
win.addEventListener('resize', handleResize); let mutationObserver; if (typeof ResizeObserver !== 'undefined') { resizeObserver = new ResizeObserver(handleResize); Array.from(tabListRef.current.children).forEach((child) => { resizeObserver.observe(child); }); }
Fixes #47035