Skip to content

[docs-infra] Fix scroll position with anchor links#40395

Closed
oliviertassinari wants to merge 1 commit intomui:masterfrom
oliviertassinari:fix-scroll-sync
Closed

[docs-infra] Fix scroll position with anchor links#40395
oliviertassinari wants to merge 1 commit intomui:masterfrom
oliviertassinari:fix-scroll-sync

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 type: bug It doesn't behave as expected. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). 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

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants