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

[useScrollLock] Fix jump with scroll-behavior style #1343

Merged
merged 6 commits into from
Jan 23, 2025

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Jan 17, 2025

Fixes #1340

@atomiks atomiks added the core Infrastructure work going on behind the scenes label Jan 17, 2025
Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit b2ffe65
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/6792150be6305200086c1ced
😎 Deploy Preview https://deploy-preview-1343--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@oliviertassinari oliviertassinari added the component: modal This is the name of the generic UI component, not the React module! label Jan 18, 2025
@atomiks atomiks marked this pull request as ready for review January 23, 2025 10:02
@@ -52,6 +53,7 @@ function preventScrollStandard(referenceElement?: Element | null) {
overflowY: html.style.overflowY,
overflowX: html.style.overflowX,
};
originalHtmlScrollBehavior = html.style.scrollBehavior;
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't it a part of originalHtmlStyles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has to be assigned after the .scrollTop/Left assignments

@atomiks atomiks merged commit d12518c into mui:master Jan 23, 2025
23 checks passed
@atomiks atomiks deleted the fix/scroll-behavior-jump branch January 23, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: modal This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dialog] Page is scrolled to top when opening the dialog if html { scroll-behavior: smooth }
3 participants