This repository was archived by the owner on Aug 25, 2022. It is now read-only.
Fixed race condition that affected Android + Chrome on mobile when a "sc...#36
Open
patricknelson wants to merge 1 commit intowebsanova:masterfrom
Open
Fixed race condition that affected Android + Chrome on mobile when a "sc...#36patricknelson wants to merge 1 commit intowebsanova:masterfrom
patricknelson wants to merge 1 commit intowebsanova:masterfrom
Conversation
…"scratchDown" callback was also setup. Fixed involves deferring callbacks so that "touchstart" will return immediately on touch devices due to delay caused by calculating percentage which is passed into all callbacks (including 'down'). Chrome will trigger a "touchcancel" event if not responding after 200ms. Also ensuring all callbacks (down/move/up) are called all the time except "move" which should be called only when "realtime" is set.
Author
|
Do you happen to maintain this repo anymore? Just curious. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ended up with a race condition that affected Android + Chrome on mobile when a "scratchDown" callback was also setup. What happened was that the callback was being called with
this._scratchPercent()being executed, which took some time in portrait mode but interestingly not landscape. Anyway, this caused Chrome 35 to automatically trigger atouchcancelevent since it took longer than 200ms to respond, which foobar'ed everything, causingtouchmoveevents never to be fired and thus created bullet holes instead of lines when attempting to scratch (just dropped a circle and did nothing else).Fixed involves deferring callbacks via
setTimeout()so thattouchstartwill return immediately. I also modified the logic on firing callbacks slightly to just excludescratchMoveif not currently set torealtimein the options.