From 0249ca944783b819efee6c142ab32f4254817d32 Mon Sep 17 00:00:00 2001 From: 11t518s <11t518s20161759@gmail.com> Date: Thu, 31 Mar 2022 18:46:17 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20checkList=20scroll=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20?= =?UTF-8?q?=EB=B6=80=EB=93=9C=EB=9F=BD=EA=B2=8C=20=EC=88=98=EC=A0=95=20#70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckListComponent/CheckListComponent.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/components/CheckListComponent/CheckListComponent.tsx b/components/CheckListComponent/CheckListComponent.tsx index 2c810a7..4efa167 100644 --- a/components/CheckListComponent/CheckListComponent.tsx +++ b/components/CheckListComponent/CheckListComponent.tsx @@ -32,6 +32,7 @@ interface IProps { } type ContextType = { translateX: number; + translateY: number; }; function CheckListComponent({ @@ -46,14 +47,17 @@ function CheckListComponent({ onBoarding, }: IProps) { const translateX = useSharedValue(0); - const [isDelete, setIsDelete] = useState(false); + const translateY = useSharedValue(0); const panGesture = useAnimatedGestureHandler({ onStart: (event, context) => { context.translateX = translateX.value; + context.translateY = translateY.value; }, onActive: (event, context) => { translateX.value = event.translationX + context.translateX; + translateY.value = event.translationY; + if (event.translationX + context.translateX > 0) { translateX.value = 0; } @@ -78,23 +82,17 @@ function CheckListComponent({ useEffect(() => { translateX.value = withTiming(0); - }, [isEdit, isDelete]); + }); return ( - { - setIsDelete(!isDelete); - }} - style={styles.whiteCard} - key={checkList.questionId} - > + {checkList.question} {checkList.rule ? (