diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-05-15 18:30:27 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-05-15 18:30:27 +1000 |
| commit | a840a16c6bd5aef906bd5cbce8293fc863cb5a5d (patch) | |
| tree | 2cd2df2b6b9d01a6f352c99dc4ba31ce9cb8743d /src/components | |
| parent | 61de82ca945685f98aad0d0c408c39e9762e2fc8 (diff) | |
Adjust resize/scroll throttling to reliably include end cases
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Tile.vue | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/Tile.vue b/src/components/Tile.vue index 995e205..da3c29c 100644 --- a/src/components/Tile.vue +++ b/src/components/Tile.vue @@ -30,7 +30,7 @@ export default defineComponent({ // Used to hide overflow on tile expansion, but not hide a sepSweptArea on subsequent transitions clickHoldTimer: 0, // Used to recognise click-and-hold events scrollOffset: 0, // Used to track scroll offset when displaying with overflow - scrollThrottled: false, + pendingScrollHdlr: false, }; }, computed: { @@ -370,9 +370,12 @@ export default defineComponent({ this.$emit('info-icon-click', nodeName); }, onScroll(evt: Event){ - if (!this.scrollThrottled){ - this.scrollOffset = this.$el.scrollTop; - setTimeout(() => {this.scrollThrottled = false;}, 300); + if (this.pendingScrollHdlr == 0){ + this.pendingScrollHdlr = setTimeout(() => { + console.log('handling scroll') + this.scrollOffset = this.$el.scrollTop; + this.pendingScrollHdlr = 0; + }, 50); } }, // Other |
