Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Set overlay opacity to 1 on reset (#30)

Emil Kowalski8804542e381f
diff --git a/src/index.tsx b/src/index.tsx
index 863e760..787e6c3 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -198,6 +198,10 @@ function Root({
transition: 'none',
});
+ set(overlayRef.current, {
+ transition: 'none',
+ });
+
// Allow dragging upwards up to 40px
if (draggedDistance > 0) {
set(drawerRef.current, {
@@ -316,6 +320,11 @@ function Root({
transition: `transform 500ms cubic-bezier(0.32, 0.72, 0, 1)`,
});
+ set(overlayRef.current, {
+ transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
+ opacity: '1',
+ });
+
// Don't reset background if swiped upwards
if (shouldScaleBackground && currentSwipeAmount > 0 && isOpen) {
set(