Skip to content

Commit

Permalink
feat(draggable): working zIndex accross all states
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Dec 4, 2023
1 parent c2dc5f5 commit d9440e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ export const Draggable: FunctionComponent<PropsWithChildren<DraggableProps>> = (
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,
Expand Down

0 comments on commit d9440e6

Please sign in to comment.