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(utils/dom): bind requestAF() to window (#6508) #6511

Merged
merged 4 commits into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const closestEl =

// `requestAnimationFrame()` convenience method
/* istanbul ignore next: JSDOM always returns the first option */
export const requestAF =
export const requestAF = (
WINDOW.requestAnimationFrame ||
WINDOW.webkitRequestAnimationFrame ||
WINDOW.mozRequestAnimationFrame ||
Expand All @@ -56,6 +56,7 @@ export const requestAF =
// Only needed for Opera Mini
/* istanbul ignore next */
(cb => setTimeout(cb, 16))
).bind(WINDOW)

export const MutationObs =
WINDOW.MutationObserver || WINDOW.WebKitMutationObserver || WINDOW.MozMutationObserver || null
Expand Down