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

Rearranging logic to deal with timing bugs. #19

Merged
merged 1 commit into from
Mar 9, 2012

Conversation

digidanny
Copy link
Contributor

Previously there was a bug that could be reproduced by typing
something very quickly, selecting all of the text and then deleting it.
A few moments later, the previous value would magically re-appear in the
text box.

This occured, because we were checking for minTermLength before
clearing the timer. So the function was returning false b/c of query
length before the timer could be cleared.

Theoretically if the input text value has changed from prevValue, the
previous query request is invalid, so it should be cleared. I moved
this logic nearer to the top of the function and checked for the minTermLength
further down, after the timer has already been cleared.

Previously there was a bug that could be reproduced by selecting typing
something very quickly, selecting all of the text and then deleting it.
A few moments later, the previous value would magically re-appear in the
text box.

This occured, because we were checking for minTermLength before
clearing the timer.  So the method was returning false b/c of query
length before the timer could be cleared.

Theoretically if the input text value has changed from prevValue, the
previous query request is invalid, so it should be cleared.  I moved
this logic nearer to the top of the function and checked for the minTermLength
further down, after the timer has already been cleared.
@meltingice meltingice merged commit 6eea6db into meltingice:master Mar 9, 2012
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.

2 participants