Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing should not fire before activated #61

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

cyberj
Copy link

@cyberj cyberj commented Feb 9, 2018

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

@mauricius
Copy link
Owner

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

@cyberj
Copy link
Author

cyberj commented Feb 11, 2018

Thanks for this issue, that will solve my problem. 👍

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 ?

@mauricius
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants