Closed Atw-Lee closed 1 year ago
solved
const reactSortableDom = useRef<HTMLElement>();
<div
onMouseMove={() => {
if (reactSortableDom.current) {
reactSortableDom.current.classList.add(styles.listWrapperHover);
reactSortableDom.current = undefined;
}
}}
>
<ReactSortable
list={items}
setList={(list) => {
onSortableCallback?.(list);
}}
className={classNames([styles.listWrapper, styles.listWrapperHover])}
delay={200}
animation={300}
onStart={(e) => {
reactSortableDom.current = e.from;
e.from.classList.remove(styles.listWrapperHover);
}}
>
{items.map((i) => (
<Item key={i.id} {...i} width={width} />
))}
</ReactSortable>
</div>
https://github.com/SortableJS/react-sortablejs/issues/171