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] Fix scroll position with anchor links #40395

Closed

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Jan 1, 2024

Before: https://mui.com/base-ui/react-slider/components-api/#Slider-classes-active

You can see the two bugs at once on this recording. First the scroll get messed up when I change the display type. Second the scroll restoration is wrong when I load the page.

Screen.Recording.2024-01-05.at.23.19.57.mov

After: https://deploy-preview-40395--material-ui.netlify.app/base-ui/react-slider/components-api/#Slider-classes-active

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work scope: docs-infra Specific to the docs-infra product labels Jan 1, 2024
@mui-bot
Copy link

mui-bot commented Jan 1, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against a2b186c

@michaldudak michaldudak requested review from a team and removed request for michaldudak January 2, 2024 14:19
@oliviertassinari oliviertassinari requested review from alexfauquette and removed request for a team January 2, 2024 15:43
@alexfauquette
Copy link
Member

alexfauquette commented Jan 2, 2024

Not sure about what you're fixing. Is it the scroll not stopping at the correct position?

What I had in mind is easier. The CSS classes have wrong anchors:

links.mp4

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Jan 2, 2024

@alexfauquette The problem I saw is the scroll position that is wrong. So indeed, I was off-topic. I'm fixing this in #40450 then. It's quick.

For the URLs, I would lean as much as possible on the kebab case, but maybe for the end of the hash, class name, prop name, matching the exact same case is better.

@oliviertassinari oliviertassinari changed the title [docs-infra] Fix anchor links [docs-infra] Fix scroll position with anchor links Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants