Skip to content

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

Merged
alexfauquette merged 2 commits intomui:masterfrom
oliviertassinari:docs-infra-polish-api
Nov 2, 2023
Merged

[docs–infra] Small polish on API toggle#39704
alexfauquette merged 2 commits intomui:masterfrom
oliviertassinari:docs-infra-polish-api

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 Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). 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 type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or 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
@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

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants