diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-11-18 16:15:25 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-11-18 16:15:25 +0100 |
| commit | f0a304ee08c9acbbeb869596b03935b55830a31e (patch) | |
| tree | af7b5d9a2b10dc6bf0d0de1fc09874de9892ed39 | |
| parent | a8be1abd5329ed6d52f0b565284cd0d41267e57a (diff) | |
cancel timeout, better safe than sorry
| -rw-r--r-- | animism-align/frontend/app/views/viewer/sections/viewer.sections.list.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) } |
