generated from solidjs-community/solid-lib-starter
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
The only way I've managed to accomplish this is by overriding onPointerDown on the draggable item and then use event.stopPropagation() when the condition is true.
However i quickly noticed that this method had some downsides. I need to play an animation on another element when the condition is true. Which now means that the animation will play as soon as someone clicks on the element and not only when a drag operation starts.
What is the intended way to solve this currently?
Edit example:
const TestComponent = () =>
{
const someCondition = createMemo<boolean>(() => false);
const handleDragStart: DragEventHandler = (e) =>
{
if(someCondition() == true)
{
//something like drag.abort() here or return false or something?
}
}
const handleDragEnd: DragEventHandler = (e) =>
{
//.. do stuff
}
return (
<DragDropProvider onDragStart={handleDragStart}
onDragEnd={handleDragEnd}>
</DragDropProvider>
)
}
Metadata
Metadata
Assignees
Labels
No labels