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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Improve side nav scroll into view #36732

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Mar 31, 2023

I noticed this during the review of #35938. We need to reset the scroll sooner than what we anticipate for:

KO: open https://mui.com/material-ui/react-checkbox/ with a browser width small enough, see how the active link is cut, it's disorienting.

Screenshot 2023-03-31 at 19 07 06

What we want, is to have the active link always in the viewport, and to also account for the URL overlay:

Screenshot 2023-03-31 at 19 08 26

Preview: https://deploy-preview-36732--material-ui.netlify.app/material-ui/react-checkbox/. It's a new iteration on the logic, something we had many iterations on already, e.g. the last one #25619.

Out of scope

There is still one thing that I HATE about the current page navigation experience is that the whole side nav rerenders on each page change, we lose all the DOM state, which means:

  • Strange hover behavior, there shouldn't be a flash of the active non hover style (dark text):
Screen.Recording.2023-04-01.at.13.56.12.mov
  • We reset the scroll, there shouldn't be a scroll move when clicking, it's disorienting:
Screen.Recording.2023-04-01.at.13.57.31.mov

Screenshot 2023-04-01 at 14 03 52

Screenshot 2023-04-01 at 14 02 23

The solution is to use a Layout component, like explored in #20907 and #36207. Actually, Marija used getLayout for Base UI in #35938 馃帀

@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer scope: docs-infra Specific to the docs-infra product labels Mar 31, 2023
@mui-bot
Copy link

mui-bot commented Mar 31, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes

Generated by 馃毇 dangerJS against 07d6683

@oliviertassinari oliviertassinari merged commit 398b557 into mui:master Apr 7, 2023
4 checks passed
@oliviertassinari oliviertassinari deleted the fix-sidenav-scroll-into-view branch April 7, 2023 23:38
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Apr 7, 2023
hbjORbj pushed a commit to hbjORbj/material-ui that referenced this pull request Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design This is about UI or UX design, please involve a designer docs Improvements or additions to the documentation scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants