Closed isteven closed 4 years ago
Yes seperate drag handle will be very helpful and user friendly. #148
It's not too crazy to implement like this:
moveable.on("dragStart", (event) => {
if (!event.inputEvent.srcElement.classList.contains("handle")) {
event.stop();
}
});
It's not too crazy to implement like this:
moveable.on("dragStart", (event) => { if (!event.inputEvent.srcElement.classList.contains("handle")) { event.stop(); } });
@mellinger how do I implement this for the React version of the library? By default the dragStart event doesn't pass event object.
(And yes I'm a React noob)
@isteven @mellinger @iprasadg
moveable's new version is released.
moveable
0.17.1react-moveable
0.20.1preact-moveable
0.19.1ngx-moveable
0.13.1svelte-moveable
0.8.1add dragTarget
, props.
like this:
moveable.dragTarget = document.querySelector(".otherTarget");
https://daybrush.com/moveable/release/latest/doc/Moveable.html#dragTarget
Hi @daybrush,
Thank you! I will try in the next few days.
To use it in the React version, is it like this?
render() {
return (
<Moveable
target={document.querySelector(".target")}
dragTarget={document.querySelector(".otherTarget")}
...
...
/>
)
}
@isteven yes.
Hi @daybrush ,
Thanks for 0.20.1 update, I am currently trying it as per your advice.
However, I encountered this error:
The context, if they can help:
I was merely following your documentation:
Environments
Description
As per title, would be great if the drag handle can be a separate element, like:
Visually, something like this
I'm quite sure a lot of people will appreciate this, as I believe many of us use this library to build some sort of multi panel / tab / window application on the web.
Thank you!