From d9440e621a422dd1eb26749ca3e3397e7c40e854 Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Mon, 4 Dec 2023 21:16:43 +0100 Subject: [PATCH] feat(draggable): working zIndex accross all states --- src/components/Draggable.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Draggable.tsx b/src/components/Draggable.tsx index 35e1cb6..d13fcfa 100644 --- a/src/components/Draggable.tsx +++ b/src/components/Draggable.tsx @@ -54,9 +54,10 @@ export const Draggable: FunctionComponent> = ( const animatedStyle = useAnimatedStyle(() => { const isActive = state.value === "dragging"; const isActing = state.value === "acting"; + const zIndex = isActive ? 999 : isActing ? 998 : 1; const style = { opacity: isActive ? activeOpacity : 1, - zIndex: isActive ? 999 : 1, + zIndex, transform: [ { translateX: offset.x.value,