@funboxteam/diamonds
Advanced tools
Comparing version 8.5.1 to 8.5.2
# Changelog | ||
## 8.5.2 (17.09.2022) | ||
Fixed [enableBodyScroll](./lib/body-scroll.ts) behavior while restoring the previously scrolled position. | ||
Now it tries to ignore `scroll-behavior: smooth` on the root node, and jumps instead of smoothly scrolling. | ||
## 8.5.1 (12.09.2022) | ||
@@ -4,0 +11,0 @@ |
@@ -12,3 +12,13 @@ "use strict"; | ||
document.body.style.marginTop = ''; | ||
window.scrollTo(window.pageXOffset, scrollTop); | ||
window.scrollTo({ | ||
left: window.pageXOffset, | ||
top: scrollTop, | ||
// 'instant' is supported by Chrome and Firefox even so it was removed from the spec years ago | ||
// also it still may be back: https://github.com/w3c/csswg-drafts/issues/3497 | ||
// it's useful here when the <html> has scroll-behavior: smooth set | ||
// we don't want smooth scroll, we want the actual jump | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// @ts-ignore | ||
behavior: 'instant', | ||
}); | ||
} | ||
@@ -15,0 +25,0 @@ } |
@@ -9,3 +9,13 @@ export function enableBodyScroll() { | ||
document.body.style.marginTop = ''; | ||
window.scrollTo(window.pageXOffset, scrollTop); | ||
window.scrollTo({ | ||
left: window.pageXOffset, | ||
top: scrollTop, | ||
// 'instant' is supported by Chrome and Firefox even so it was removed from the spec years ago | ||
// also it still may be back: https://github.com/w3c/csswg-drafts/issues/3497 | ||
// it's useful here when the <html> has scroll-behavior: smooth set | ||
// we don't want smooth scroll, we want the actual jump | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// @ts-ignore | ||
behavior: 'instant', | ||
}); | ||
} | ||
@@ -12,0 +22,0 @@ } |
{ | ||
"name": "@funboxteam/diamonds", | ||
"version": "8.5.1", | ||
"version": "8.5.2", | ||
"description": "A shiny pile of typed JS helpers for everyday use", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85329
1272