fix(ui): improve dragging activation

- delay of 250ms
- prevent gallery images from accidentally activating native drag and drop
This commit is contained in:
psychedelicious 2023-06-07 15:40:43 +10:00
parent de0fd87035
commit 0843028e6e
2 changed files with 3 additions and 2 deletions

View File

@ -40,11 +40,11 @@ const ImageDndContext = (props: ImageDndContextProps) => {
);
const mouseSensor = useSensor(MouseSensor, {
activationConstraint: { distance: 15 },
activationConstraint: { delay: 250, tolerance: 5 },
});
const touchSensor = useSensor(TouchSensor, {
activationConstraint: { distance: 15 },
activationConstraint: { delay: 250, tolerance: 5 },
});
// TODO: Use KeyboardSensor - needs composition of multiple collisionDetection algos
// Alternatively, fix `rectIntersection` collection detection to work with the drag overlay

View File

@ -279,6 +279,7 @@ const HoverableImage = memo((props: HoverableImageProps) => {
objectFit={
shouldUseSingleGalleryColumn ? 'contain' : galleryImageObjectFit
}
draggable={false}
rounded="md"
src={thumbnail_url || image_url}
fallback={<FaImage />}