diff --git a/packages/nc-gui/app.vue b/packages/nc-gui/app.vue index cb78700e70..f51a70eaaf 100644 --- a/packages/nc-gui/app.vue +++ b/packages/nc-gui/app.vue @@ -96,6 +96,27 @@ onMounted(() => { refreshCommandPalette() }) }) + +// ref: https://github.com/vuejs/vue-cli/issues/7431#issuecomment-1793385162 +// Stop error resizeObserver +const debounce = (callback: (...args: any[]) => void, delay: number) => { + let tid: any + return function (...args: any[]) { + const ctx = self + tid && clearTimeout(tid) + tid = setTimeout(() => { + callback.apply(ctx, args) + }, delay) + } +} + +const _ = (window as any).ResizeObserver +;(window as any).ResizeObserver = class ResizeObserver extends _ { + constructor(callback: (...args: any[]) => void) { + callback = debounce(callback, 20) + super(callback) + } +}