fix: dnd on pages section (#5202)

This commit is contained in:
Gandharv 2023-01-05 11:26:30 +05:30 committed by GitHub
parent b714c71cd9
commit 5b3add2bff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ import { SortableItem, SortableOverlay } from './components';
export function SortableList({ items, onChange, renderItem }) {
const [active, setActive] = useState(null);
const activeItem = useMemo(() => items.find((item) => item.id === active?.id), [active, items]);
// const activeItem = useMemo(() => items.find((item) => item.id === active?.id), [active, items]);
const sensors = useSensors(
useSensor(PointerSensor),
useSensor(KeyboardSensor, {
@ -40,7 +40,7 @@ export function SortableList({ items, onChange, renderItem }) {
<React.Fragment key={item.id}>{renderItem(item)}</React.Fragment>
))}
</SortableContext>
<SortableOverlay>{activeItem ? renderItem(activeItem) : null}</SortableOverlay>
{/* <SortableOverlay>{activeItem ? renderItem(activeItem) : null}</SortableOverlay> */}
</DndContext>
);
}