In navigation drawer, cursor should not be drag on hover and some enhancements (#8975)

as per the title- on hover, the draggable items had a grab cursor.
Couldn't change it to a pointer, because then onClick would have a weird
behavior of grab which causes lag onClick.
This commit is contained in:
nitin
2024-12-13 19:07:46 +05:30
committed by GitHub
parent 9579f22bc2
commit 257834ea71
5 changed files with 47 additions and 22 deletions

View File

@ -3,12 +3,14 @@ import {
DragDropContext,
Droppable,
OnDragEndResponder,
OnDragStartResponder,
} from '@hello-pangea/dnd';
import { useState } from 'react';
import { v4 } from 'uuid';
type DraggableListProps = {
draggableItems: React.ReactNode;
onDragEnd: OnDragEndResponder;
onDragStart?: OnDragStartResponder;
};
const StyledDragDropItemsWrapper = styled.div`
@ -18,11 +20,12 @@ const StyledDragDropItemsWrapper = styled.div`
export const DraggableList = ({
draggableItems,
onDragEnd,
onDragStart,
}: DraggableListProps) => {
const [v4Persistable] = useState(v4());
return (
<DragDropContext onDragEnd={onDragEnd}>
<DragDropContext onDragEnd={onDragEnd} onDragStart={onDragStart}>
<StyledDragDropItemsWrapper>
<Droppable droppableId={v4Persistable}>
{(provided) => (