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

Interact Could Warn if Resize is Enabled But All Edges Are Disabled #448

Closed
machineghost opened this issue Nov 15, 2016 · 3 comments
Closed

Comments

@machineghost
Copy link

machineghost commented Nov 15, 2016

I'm an Interact.js n00b, and I just recently lost a bit of time because I made the mistake of enabling resizing, but not setting any edges. Debugging this was tricky because the library still fired resize events ... but rect never changed and deltaRect was all 0's.

Eventually by experimenting with the options I figured the problem out, but as a convenience to newer users it might be nice to give some sort of warning when a resize event triggers and and interact instance has resizing enabled but does not have any edges enabled. Since this is sort of a garbage case anyway (what's the point of turning resizing on if you can't resize?) this might even warrant throwing an exception.

Just a thought. Regardless, thanks for writing Interact.js!

@taye
Copy link
Owner

taye commented Nov 28, 2016

I see the value in this but a lot of people are opposed to harmless warnings (#240, #277) so I'll have to refuse. I'll try to remember to add an entry to the FAQ or elsewhere in the docs though.

Thanks for bringing this up.

@taye taye closed this as completed Nov 28, 2016
@machineghost
Copy link
Author

Thanks, at least that's better than nothing.

Just out of curiosity, what is the legitimate use case for this scenario (ie. why not just make it throw an exception instead of a warning, if it's a case that should never occur)?

@taye
Copy link
Owner

taye commented Dec 9, 2016

Having all edges disabled could be used to intentionally disable resizing so it's worth allowing it to happen.

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

No branches or pull requests

2 participants