From f0a304ee08c9acbbeb869596b03935b55830a31e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 18 Nov 2020 16:15:25 +0100 Subject: cancel timeout, better safe than sorry --- .../frontend/app/views/viewer/sections/viewer.sections.list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'animism-align/frontend') diff --git a/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js b/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js index 3ce1cc1..0d34a45 100644 --- a/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js +++ b/animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js @@ -24,7 +24,8 @@ class ViewerSectionsList extends Component { } scrollToSection(section) { const dx = section.index * SECTION_WIDTH - setTimeout(() => { + clearTimeout(this.timeout) + this.timeout = setTimeout(() => { this.scrollRef.current.scrollTo(dx, 0) }, 500) } -- cgit v1.2.3-70-g09d2