Skip to content

Commit

Permalink
fix(table): resizeObserver loop limit exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
tomieric committed Aug 23, 2021
1 parent a87ce4b commit 6268f0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/resize-event.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ResizeObserver from 'resize-observer-polyfill';
import { debounce } from 'throttle-debounce';

const isServer = typeof window === 'undefined';

Expand All @@ -19,7 +20,7 @@ export const addResizeListener = function(element, fn) {
if (isServer) return;
if (!element.__resizeListeners__) {
element.__resizeListeners__ = [];
element.__ro__ = new ResizeObserver(resizeHandler);
element.__ro__ = new ResizeObserver(debounce(16, true, resizeHandler));
element.__ro__.observe(element);
}
element.__resizeListeners__.push(fn);
Expand Down

0 comments on commit 6268f0a

Please sign in to comment.