Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Fix scroll top with smooth scroll (#219)

Emil Kowalski3b903394575f
diff --git a/src/index.tsx b/src/index.tsx
index 28f3104..afa34ba 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -405,6 +405,7 @@ function Root({
}, 300);
setTimeout(() => {
+ reset(document.documentElement, 'scrollBehavior');
if (snapPoints) {
setActiveSnapPoint(snapPoints[0]);
}
@@ -552,6 +553,10 @@ function Root({
React.useEffect(() => {
// Trigger enter animation without using CSS animation
if (isOpen) {
+ set(document.documentElement, {
+ scrollBehavior: 'auto',
+ });
+
openTime.current = new Date();
scaleBackground(true);
}