moveable
moveable copied to clipboard
The button event can not be triggered
Environments
- Framework name: null
- Framework version: null
- Moveable Component version: 0.26.0
- Testable Address(optional): https://codesandbox.io/s/moveable-jpwgh?file=/index.html
Description
When upgrade moveable to latest version (v0.26.0), the button event can not be triggered.
https://codesandbox.io/s/moveable-jpwgh?file=/index.html
@nzbin
The click event is blocked.
Use moveable's click event instead.
<Moveable onClick={e=>{}}/>
new Moveable.on("click", e => {
});
I am very confused. I have updated the demo, there has three different button, how can I trigger the different event?
There has many complex scenario that need capture events binding to element in Moveable.
@nzbin
I will change it so that it does not block the click event in the next version.
Great, many thanks!
Well, amazing. Today I was facing the same issue and I was trying to bang my head. Basically, when the draggable = true, I do not get the click event on the element. I hope this issue will solve that.
Thanks for the test release. I realized later that this issue is for React apps while I'm using vanilla JS in my Angular app.
Hi, @daybrush. As I have mentioned above, I'm actually facing the same issue with Vanilla JS (using 0.26.0). When the draggable is set to true on an element, any of its child nodes/elements are not receiving the click event.
While this problem does not exist if draggable: false. For example- when I try to click on that image in the screenshot, the click event is not received on the image element, and it only comes to the parent, i.e. selected element.

For now, I have added this hack as a workaround to the problem-

Any thoughts? Maybe instead of fixing at React, some fix is required at the lower level?
@sagrawal31 @nzbin
moveable0.27.1react-moveable0.30.1preact-moveable0.29.1ngx-moveable0.23.1svelte-moveable0.18.1lit-moveable0.4.1vue-moveable2.0.0-beta.3vue3-moveable0.2.1
moveable's new version is released. Check it again.
@daybrush, I just tested the release 0.27.1, and the problem is gone 🤩 Thanks a ton!