Skip to content

Commit f8caaec

Browse files
fix(utils/dom): bind requestAF() to window (#6508) (#6511)
* fix(utils-dom): bind requestAF to WINDOW (#6508) * Update dom.js Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
1 parent 340908c commit f8caaec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/dom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const closestEl =
4646

4747
// `requestAnimationFrame()` convenience method
4848
/* istanbul ignore next: JSDOM always returns the first option */
49-
export const requestAF =
49+
export const requestAF = (
5050
WINDOW.requestAnimationFrame ||
5151
WINDOW.webkitRequestAnimationFrame ||
5252
WINDOW.mozRequestAnimationFrame ||
@@ -56,6 +56,7 @@ export const requestAF =
5656
// Only needed for Opera Mini
5757
/* istanbul ignore next */
5858
(cb => setTimeout(cb, 16))
59+
).bind(WINDOW)
5960

6061
export const MutationObs =
6162
WINDOW.MutationObserver || WINDOW.WebKitMutationObserver || WINDOW.MozMutationObserver || null

0 commit comments

Comments
 (0)