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

[docs–infra] Small polish on API toggle #39704

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 1, 2023

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

@oliviertassinari oliviertassinari added the scope: docs-infra Specific to the docs-infra product label Nov 1, 2023
@mui-bot
Copy link

mui-bot commented Nov 1, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 7f36aba

@oliviertassinari oliviertassinari added the enhancement This is not a bug, nor a new feature label Nov 2, 2023
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

That's cleaner 👍

@alexfauquette alexfauquette merged commit b30069d into mui:master Nov 2, 2023
21 checks passed
@oliviertassinari oliviertassinari deleted the docs-infra-polish-api branch November 2, 2023 10:37
oliviertassinari added a commit that referenced this pull request Nov 3, 2023
Comment on lines -82 to -91
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]);
Copy link
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants