From c93fdff28b6561483a752cd5808aa7bb7fc264fc Mon Sep 17 00:00:00 2001 From: toririm Date: Sun, 6 Oct 2024 11:03:02 +0900 Subject: [PATCH] =?UTF-8?q?pos=20/cashier-v2=20=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/organisms/OrderItemEdit.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/organisms/OrderItemEdit.tsx b/app/components/organisms/OrderItemEdit.tsx index 12b69201..dcc86862 100644 --- a/app/components/organisms/OrderItemEdit.tsx +++ b/app/components/organisms/OrderItemEdit.tsx @@ -129,6 +129,7 @@ const OrderItemEdit = ({ useEffect(() => { if (!focus) { setItemFocus(-1); + setEditable(false); } else { setItemFocus(0); } @@ -136,7 +137,9 @@ const OrderItemEdit = ({ // itemFocus が range 外に出ないように調整 useEffect(() => { - setItemFocus((prev) => Math.min(order.items.length - 1, Math.max(0, prev))); + setItemFocus((prev) => + Math.min(order.items.length - 1, Math.max(-1, prev)), + ); }); return (