Essentially, I think making the error messages more modular (as in being able to replace/remove the default error messages when using the handle
or class
options) might be an interesting addition to the action. In this way, you don't have to wrap the @neoDrag action around your own custom svelte action. Currently, this is the strategy I'm using to hack my way around some error messages that I don't want to enforce.
In specific, when I right click on a card that is draggable, I remove the .handle
class from the component, thus rendering it undraggable. When attempting to drag this undraggable element, the following error message gets logged:
Uncaught Error: Selector passed for `handle` option should be child of the element on which the action is applied
Normally, this error message would make perfect sense, as the child of the neodrag element does not have the .handle
class anymore. In my implementation, this is actually correct. It's the only way I've found to turn draggability on/off in a reactive fashion.
I was kinda forced to do this since the disabled option didn't work with a reactive ref... Honestly though, this strategy is working great other than that error stuff. So, I guess another thing that I might suggest looking into is how to incorporate reactive refs as params for the disabled
option! Thanks for such a great library!