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

Fix timing issue in Chrome #71

Merged
merged 1 commit into from
Dec 5, 2016
Merged

Conversation

chrisvasz
Copy link
Contributor

This change fixes a hard-to-debug and reproduce issue in Chrome. In one window, I can't sort anything at all, either in my application or even on the GitHub pages site. In another Incognito window in the same version of Chrome, I can sort just fine. I think it is a timing issue related to the way setTimeout and the setState inside handlePress interact with each other. I tried eliminating the setTimeout when pressDelay === 0 and the (alleged) timing issue went away.

@clauderic
Copy link
Owner

Hmmm 🤔 Interesting. And are you seeing similar issues when there is a pressDelay?

@clauderic
Copy link
Owner

If you're not seeing the issue in incognito, might I suggest you take a look at your extensions? You may have a chrome extension enabled that's causing the issues you're seeing (and then the extension is disabled in incognito, which is the chrome default for most extensions)

@chrisvasz
Copy link
Contributor Author

I tried disabling all my extensions and it made no difference. That matches my empirical experience -- seems like it works on some days and not others. The most recent environmental change was an update to Chrome 55 beta, but the fact that it works in Incognito mode rules out Chrome version.

I also tried adding a pressDelay of 200, and neither this proposed fix nor the existing code worked for me in that case. Haven't explored any further.

@clauderic
Copy link
Owner

Hmm. I'm unable to replicate this at the moment. Let me update to the latest version of chrome and I'll get back to you.

@frontendphil
Copy link
Contributor

+1 on this. When pressDelay is 0 then there is no reason to break the sync chain of calls here.

@clauderic clauderic merged commit fce6ef1 into clauderic:master Dec 5, 2016
@chrisvasz chrisvasz deleted the patch-1 branch December 5, 2016 15:14
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.

3 participants