A drawer component for React.
fix: initial nested transform (#491)
Jeremias Jutz5bccd2c90956
diff --git a/src/index.tsx b/src/index.tsxindex 76aad6d..503c648 100644--- a/src/index.tsx+++ b/src/index.tsx@@ -680,7 +680,7 @@ export function Root({function onNestedOpenChange(o: boolean) {const scale = o ? (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth : 1;- const y = o ? -NESTED_DISPLACEMENT : 0;+ const initialTranslate = o ? -NESTED_DISPLACEMENT : 0;if (nestedOpenChangeTimer.current) {window.clearTimeout(nestedOpenChangeTimer.current);@@ -688,7 +688,7 @@ export function Root({set(drawerRef.current, {transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,- transform: `scale(${scale}) translate3d(0, ${y}px, 0)`,+ transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${initialTranslate}px, 0)` : `scale(${scale}) translate3d(${initialTranslate}, 0, 0)`,});if (!o && drawerRef.current) {