-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Call rAF with window/global scope #820
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
Closed
Closed
Conversation
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
Chrome seems to break when invoking rAF stored as a referenced property of a different object other than the global scope. For example: https://stackoverflow.com/questions/9677985/uncaught-typeerror-illegal-invocation-in-chrome Error is below: ``` parallax.cjs.js:195 Uncaught TypeError: Illegal invocation at onScroll (parallax.cjs.js:195) at HTMLUnknownElement.callCallback (react-dom.development.js:348) at Object.invokeGuardedCallbackDev (react-dom.development.js:398) at invokeGuardedCallback (react-dom.development.js:455) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:469) at executeDispatch (react-dom.development.js:601) at executeDispatchesInOrder (react-dom.development.js:623) at executeDispatchesAndRelease (react-dom.development.js:726) at executeDispatchesAndReleaseTopLevel (react-dom.development.js:734) at forEachAccumulated (react-dom.development.js:708) ``` ``` var onScroll = function onScroll(event) { if (!state.busy) { state.busy = true; state.current = event.target[getScrollType(horizontal)]; globals.requestAnimationFrame(function () { state.layers.forEach(function (layer) { return layer.setPosition(state.space, state.current); }); state.busy = false; }); } }; ```
aleclarson
added a commit
that referenced
this pull request
Sep 30, 2019
@aleclarson Can this get merged into |
Please try If that doesn't work for you, I can release a |
👍 ty! |
Tested; seems to be working correctly. In retrospect, for anyone else reading:
|
aleclarson
added a commit
that referenced
this pull request
Oct 2, 2019
aleclarson
added a commit
that referenced
this pull request
Oct 3, 2019
aleclarson
added a commit
that referenced
this pull request
Oct 6, 2019
aleclarson
added a commit
that referenced
this pull request
May 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Chrome seems to break when invoking rAF stored as a referenced property of a different object other than the global scope.
For example: https://stackoverflow.com/questions/9677985/uncaught-typeerror-illegal-invocation-in-chrome
Error is below:
CC: @aleclarson