Use window.requestAnimationFrame in Tabs.js

Call requestAnimationFrame on window object to fix headless testing
with jsdom without hacking around by defining global vars
old
Richard Nespithal 2017-11-02 17:36:57 +01:00
parent b381db4054
commit bc05c693d6
No known key found for this signature in database
GPG Key ID: 89C6EE6B7BFDB1AA
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ const factory = (Tab, TabContent, FontIcon) => {
updatePointer = (idx) => {
if (this.navigationNode && this.navigationNode.children[idx]) {
this.updatePointerAnimationFrame = requestAnimationFrame(() => {
this.updatePointerAnimationFrame = window.requestAnimationFrame(() => {
const nav = this.navigationNode.getBoundingClientRect();
const label = this.navigationNode.children[idx].getBoundingClientRect();
const scrollLeft = this.navigationNode.scrollLeft;