diff --git a/src/components/ResponsiveDrawer.tsx b/src/components/ResponsiveDrawer.tsx index 7291e47..8756b40 100644 --- a/src/components/ResponsiveDrawer.tsx +++ b/src/components/ResponsiveDrawer.tsx @@ -74,12 +74,19 @@ export function ResponsiveDrawer({ if (isSwipe && drawerState) { setIsMenuVisible(false); } else if (!isSwipe && drawerState) { - setIsMenuVisible(true); + const setTimer = setTimeout(() => { + // drawerStateがfalseになっているかチェック + if (!drawerState) { + return; + } + setIsMenuVisible(true); + }, 170); + return () => clearTimeout(setTimer); } else { setIsMenuVisible(false); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isSwipe]); + // drawerStateを依存配列に追加 + }, [isSwipe, drawerState]); const theme = useTheme(); diff --git a/src/components/SortableList/SortableList.tsx b/src/components/SortableList/SortableList.tsx index 7cbb9cb..5878ce3 100644 --- a/src/components/SortableList/SortableList.tsx +++ b/src/components/SortableList/SortableList.tsx @@ -1,5 +1,5 @@ import { FC, useState } from 'react'; -import { DndContext, DragOverlay, UniqueIdentifier, closestCenter, defaultDropAnimationSideEffects } from '@dnd-kit/core'; +import { DndContext, DragOverlay, UniqueIdentifier, closestCenter } from '@dnd-kit/core'; import { arrayMove, SortableContext } from '@dnd-kit/sortable'; import { restrictToVerticalAxis } from '@dnd-kit/modifiers'; @@ -31,8 +31,8 @@ export const SortableList: FC = ({ return ( <> { setActiveId(event.active.id as number); }} @@ -60,17 +60,7 @@ export const SortableList: FC = ({ /> ))} - + {activeItem && ( = ({ item, handlerProps, cu minWidth: '20px', height: '20px', mr: '10px', + touchAction: 'none', + zIndex: 1500, }} {...handlerProps?.attributes} {...handlerProps?.listeners}