Dragged Item
in GridList
component disable button interaction
#5243
Unanswered
armandabric
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Because this is passed on the context from GridList to Button with slot drag. You could intercept it and just remove that piece. You'd need to make sure the button is always visible though and has a big enough hit area for a touch user. simplified example derived from https://react-spectrum.adobe.com/react-aria/Button.html#advanced-customization
|
Beta Was this translation helpful? Give feedback.
3 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.
-
Hey everyone,
I'm experimenting with drag and drop capabilities of the
GridList
component and after some try I succeed to have my nice draggable list. Well done guys 👍I got stuck when I start to use our custom button component as drad handler. I discovered that the drag handler (
slot="drag"
) got a stylepointer-event: none;
force on him.react-spectrum/packages/react-aria-components/src/GridList.tsx
Lines 354 to 360 in d334cde
I get the why: bubble up de the event to allow the
Item
to handle all the drag stuff). But the consequence is that the button hover/press state are not shown anymore witch is not nice at all for a design system.With the
DragList
, is there a way to, at least, allow the drag handler adapt it appearance on hover/press? Or even better, only use the drag handler to trigger the drag (do not make the fullItem
draggable)?I suppose I could do the latter by using directly the underlying hooks. But this will come with an higher maintenance cost.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions