kirillmurashov/vue-drag-resize

How to execute click event?

Closed this issue · 2 comments

there is image for the code
image

I want to execute the top click event 'mainClick' , but it always execute the dragging or resizing first , I don't like it . And the click event 'test1' and 'test2' no execute . How to solve it?

this is the click result , I just click
image
I don't want the '1' appear ,only need the '2' . In my project the '1' will cause serious problems

This is just a guess how to get test1 executed. Maybe worth a try: <vue-drag-resize … @clicked="test1"> (the component fires a 'clicked' event inside its @mousedown.stop.prevent handler).

test2 should already be fired. It won't be fired in the Chrome mobile view (touch mode) or on mobile devices though. You might want to <div :id="item.attributes.attr.id.value" @click="test2" @touchend="test2"> in order for it to work then.

Also try @click.capture="mainClick" to change the order of dragging and mainClick.

@tpraxl

Thank you !
I have found solution for the dragging first execution problem .

I am modeled the dome , but something error when toggle the div with click . the first clicked div will cover the second clicked div by position when the second clicked , I found it cause by I update the state without mutations in dragging and resizing event after I see the dome code .

I change the update commit to mutations ,it's OK . I don't know why it , the watch is still work (watch the state change to update the div)