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.
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 beforeinit()
is run, so doesn't really add any protection.I'd propose that
active()
should be false, untilinit()
is complete, or that the binding of theinput
andchange
events should happen within or after theinit()
to prevent this race condition.Any thoughts?