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

Binding to 'input' and 'change' events too early? #29

Open
SirRawlins opened this issue Mar 23, 2017 · 0 comments
Open

Binding to 'input' and 'change' events too early? #29

SirRawlins opened this issue Mar 23, 2017 · 0 comments

Comments

@SirRawlins
Copy link

I've come across a race condition this morning whereby typing in a form field before Stretchy has inited results in the field being resized, even if it doesn't match the filter criteria.

My current hunch on this is that we're binding to the 'input' and 'change' events on the document before the plugin has inited, meaning it can receive resize() calls before the filters are in place.

It looks like listener() is checking an active flag, but the flag is always true, even before init() is run, so doesn't really add any protection.

I'd propose that active() should be false, until init() is complete, or that the binding of the input and change events should happen within or after the init() to prevent this race condition.

Any thoughts?

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

1 participant