Browse Source

fix: use debounced refresh for resize observer

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5015/head
mertmit 2 years ago
parent
commit
284fea2462
  1. 6
      packages/nc-gui/components/cell/ClampedText.vue

6
packages/nc-gui/components/cell/ClampedText.vue

@ -8,9 +8,13 @@ const wrapper = ref()
const key = ref(0) const key = ref(0)
const debouncedRefresh = useDebounceFn(() => {
key.value++
}, 500)
onMounted(() => { onMounted(() => {
const observer = new ResizeObserver(() => { const observer = new ResizeObserver(() => {
key.value++ debouncedRefresh()
}) })
observer.observe(wrapper.value) observer.observe(wrapper.value)

Loading…
Cancel
Save