Use window.requestAnimationFrame in Tabs.js
Call requestAnimationFrame on window object to fix headless testing with jsdom without hacking around by defining global varsold
parent
b381db4054
commit
bc05c693d6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue