Skip to content

Commit

Permalink
fix(utils/dom): bind requestAF() to window (#6508) (#6511)
Browse files Browse the repository at this point in the history
* fix(utils-dom): bind requestAF to WINDOW (#6508)

* Update dom.js

Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
  • Loading branch information
xenolithviktor and jacobmllr95 committed May 4, 2021
1 parent 340908c commit f8caaec
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit f8caaec

Please sign in to comment.