How to implement a simple delete button? #1029
Unanswered
MattHeslington
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello Matt, if you are unable to click the button to call the onRemove method, you can set a delay to the drag event, this way, the user has to press the mouse button for a certain time before the drag event starts. This way, you are able to click buttons. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Thank you for the great library. I've been able to build an sortable image grid. I just need now to be able to add a button to each image container which removes the item from items array. I've searched everywhere, looked through so many codesandboxes and github repos, with no luck.
This is my DndContext:
My SortablePhoto component looks like this:
While the actual photo component with the remove button is as so:
I see on the official Storybook there's an example showing removable items in the examples/pages section, and looking at the code there's an 'onRemove' function - but I just can't get it to work - can anyone see what I'm doing wrong please?
Many thanks for any help - Matt
Beta Was this translation helpful? Give feedback.
All reactions