vue-draggable-resizable icon indicating copy to clipboard operation
vue-draggable-resizable copied to clipboard

Resizing should not fire before activated

Open cyberj opened this issue 7 years ago • 3 comments

Actually when you click (without moving) on a disabled component the resizing event is fired before activated

Problem is, I have multiple resizable components in a v-for loop, and I want to know which one will be resized/dragged.

If I try : @resizing="onResize(index, $event) my method will only get the first $emit parameter (integer for left pos)

So I try my luck by passing the index to @activated to set an index (like this.elselected) but he is called after the resizing event.

This PR suppress any resizing event happening before the activated event

cyberj avatar Feb 09 '18 20:02 cyberj

You're right. The resizing event should not fire before activated. Can you remove the forceEmit parameter? In my opinion it only adds useless complexity.

Also take a look to this issue. It might help you with your use case.

Thanks

mauricius avatar Feb 10 '18 09:02 mauricius

Thanks for this issue, that will solve my problem. :+1:

forceEmit is here because the mounted handler need to call this.reviewDimensions() and three of your tests fails if the event is not fired when the component is mounted.

Should I remove it anyway and change the unit tests accordingly ?

cyberj avatar Feb 11 '18 21:02 cyberj

Sorry for the delay. Yes feel free to change the tests, as long as existing functionalities keep working.

In my opinion the event should fire only if the component is actually dragged or resized.

mauricius avatar Mar 12 '18 21:03 mauricius