Improve default DragPreview mouse coordinates #4801
Closed
AlexGalays
started this conversation in
Ideas
Replies: 1 comment
-
This seems like an improvement to me, feel free to make a PR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What do you think about the below improvement at:
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/dnd/src/useDrag.ts#L140C1-L143C10
instead:
This fixes two things:
The preview height can be smaller than the original item height but have the same width (or vice versa): the new code will keep an axis coordinate if it fits. Aggressively defaulting to the middle is very strange when you initiate the drag from the right hand side, just because ONE dimension doesn't fit.
It feels way more natural to me to default to the same general area/proportions of where the drag was initiated.
Beta Was this translation helpful? Give feedback.
All reactions