diff --git a/components/tabs/Tabs.js b/components/tabs/Tabs.js index 81c73458..53341ccd 100644 --- a/components/tabs/Tabs.js +++ b/components/tabs/Tabs.js @@ -64,6 +64,7 @@ const factory = (Tab, TabContent, FontIcon) => { componentWillUnmount() { window.removeEventListener('resize', this.handleResize); clearTimeout(this.resizeTimeout); + if (this.updatePointerAnimationFrame) cancelAnimationFrame(this.updatePointerAnimationFrame); } handleHeaderClick = (idx) => { @@ -82,7 +83,7 @@ const factory = (Tab, TabContent, FontIcon) => { updatePointer = (idx) => { if (this.navigationNode && this.navigationNode.children[idx]) { - requestAnimationFrame(() => { + this.updatePointerAnimationFrame = requestAnimationFrame(() => { const nav = this.navigationNode.getBoundingClientRect(); const label = this.navigationNode.children[idx].getBoundingClientRect(); const scrollLeft = this.navigationNode.scrollLeft;