From 31a070c224856ff79d26e0c3177b8d22a39bd905 Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 19 Jan 2024 17:32:23 +0100 Subject: [PATCH] klicker: Fix resizeobserver loop limit exceeded --- .../components/ui/b-scrolling-dashboard.vue | 40 +++++++++---------- klicker/components/ui/b-vega.vue | 2 +- .../components/visualisations/v-barplot.vue | 4 +- klicker/components/visualisations/v-roll.vue | 4 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/klicker/components/ui/b-scrolling-dashboard.vue b/klicker/components/ui/b-scrolling-dashboard.vue index 125f2791..84f4a038 100644 --- a/klicker/components/ui/b-scrolling-dashboard.vue +++ b/klicker/components/ui/b-scrolling-dashboard.vue @@ -105,28 +105,26 @@ export default defineComponent({ const arrivedLeft = ref(true) const arrivedRight = ref(true) - const onUpdate = (cause: 'scroll'|'rerender') => { - requestAnimationFrame(() => { - if (cause == 'scroll') { - emit(cause, { - x: scroll.x.value, - arrivedLeft: scroll.arrivedState.left, - arrivedRight: scroll.arrivedState.right, - }) - } - if (cause == 'rerender') { - emit(cause, { - x: scroll.x.value, - arrivedLeft: scroll.arrivedState.left, - arrivedRight: scroll.arrivedState.right, - }) - } + const onUpdate = (cause: 'scroll'|'rerender') => requestAnimationFrame(() => { + if (cause == 'scroll') { + emit(cause, { + x: scroll.x.value, + arrivedLeft: scroll.arrivedState.left, + arrivedRight: scroll.arrivedState.right, + }) + } + if (cause == 'rerender') { + emit(cause, { + x: scroll.x.value, + arrivedLeft: scroll.arrivedState.left, + arrivedRight: scroll.arrivedState.right, + }) + } - const scrollable = wrapper.value != undefined && wrapper.value.scrollWidth > wrapper.value.clientWidth - arrivedLeft.value = scroll.arrivedState.left || !scrollable - arrivedRight.value = scroll.arrivedState.right || !scrollable - }) - } + const scrollable = wrapper.value != undefined && wrapper.value.scrollWidth > wrapper.value.clientWidth + arrivedLeft.value = scroll.arrivedState.left || !scrollable + arrivedRight.value = scroll.arrivedState.right || !scrollable + }) const scroll = useScroll(wrapper, { onScroll: () => onUpdate('scroll'), diff --git a/klicker/components/ui/b-vega.vue b/klicker/components/ui/b-vega.vue index be514c1a..50ecd634 100644 --- a/klicker/components/ui/b-vega.vue +++ b/klicker/components/ui/b-vega.vue @@ -29,7 +29,7 @@