Skip to content

Commit

Permalink
Fix zIndex to allow Draggable being rendered on top of others
Browse files Browse the repository at this point in the history
Mentionned in #90
  • Loading branch information
Brandon Vigne committed Dec 6, 2023
1 parent 502f92d commit b05af09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ export default function Draggable(props) {
left: 0,
width: Window.width,
height: Window.height,
elevation: z,
zIndex: z,
};
}, []);
}, [z]);

const dragItemCss = React.useMemo(() => {
const style = {
top: y,
left: x,
elevation: z,
zIndex: z,
};
if (renderColor) {
style.backgroundColor = renderColor;
Expand All @@ -208,7 +208,7 @@ export default function Draggable(props) {
width: renderSize,
height: renderSize,
};
}, [children, isCircle, renderColor, renderSize, x, y, z]);
}, [children, isCircle, renderColor, renderSize, x, y]);

const touchableContent = React.useMemo(() => {
if (children) {
Expand Down
8 changes: 4 additions & 4 deletions Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ export default function Draggable(props: IProps) {
left: 0,
width: Window.width,
height: Window.height,
elevation: z,
zIndex: z,
};
}, []);
}, [z]);

const dragItemCss = React.useMemo(() => {
const style: StyleProp<ViewStyle> = {
top: y,
left: x,
elevation: z,
zIndex: z,
};
if (renderColor) {
style.backgroundColor = renderColor;
Expand All @@ -240,7 +240,7 @@ export default function Draggable(props: IProps) {
width: renderSize,
height: renderSize,
};
}, [children, isCircle, renderColor, renderSize, x, y, z]);
}, [children, isCircle, renderColor, renderSize, x, y]);

const touchableContent = React.useMemo(() => {
if (children) {
Expand Down

0 comments on commit b05af09

Please sign in to comment.