Skip to content

Commit 73bb00a

Browse files
fix(CodeEditor) resizeObserver resize loop (#10644)
* fix(CodeEditor) resizeObserver resize loop * yarn * add debounce --------- Co-authored-by: Titani <tlabaj@redhat.com>
1 parent b343abb commit 73bb00a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-core/src/helpers/resizeObserver.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { canUseDOM } from './util';
1+
import { canUseDOM, debounce } from './util';
22

33
/**
44
* This function creates a ResizeObserver used to handle resize events for the given containerRef. If ResizeObserver
@@ -83,7 +83,7 @@ export const getResizeObserver = (
8383
if (useRequestAnimationFrame) {
8484
window.requestAnimationFrame(() => {
8585
if (Array.isArray(entries) && entries.length > 0) {
86-
handleResize();
86+
debounce(handleResize, 100);
8787
}
8888
});
8989
// Avoid wrapping function in requestAnimationFrame if the function is debounced

0 commit comments

Comments
 (0)