-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
[docs–infra] Small polish on API toggle #39704
[docs–infra] Small polish on API toggle #39704
Conversation
Netlify deploy previewhttps://deploy-preview-39704--material-ui.netlify.app/ Bundle size report |
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.
That's cleaner 👍
This reverts commit b30069d.
setNeedsScroll(false); | ||
if (needsScroll) { | ||
return () => { | ||
const id = document?.location.hash.slice(1); | ||
const element = document.getElementById(id); | ||
element?.scrollIntoView(); | ||
}; | ||
if (option !== DEFAULT_LAYOUT) { | ||
const id = document.location.hash.slice(1); | ||
const element = document.getElementById(id); | ||
element?.scrollIntoView(); | ||
} | ||
return () => {}; | ||
}, [needsScroll]); |
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.
I shouldn't have changed this, introducing the logic back in #40395. It led to a bug, the scroll override after first render (the effect re-run).
A quick follow-up on #39490.
My main concern was about the double render, I didn't benchmark it, but I would expect it not to help with the performance of the page.
Preview: https://deploy-preview-39704--material-ui.netlify.app/material-ui/api/autocomplete/#Autocomplete-prop-renderInput