@@ -22,6 +22,7 @@ import {
2222 useCallback ,
2323 useRef ,
2424 useEffect ,
25+ useLayoutEffect ,
2526 useMemo ,
2627 memo ,
2728 RefObject ,
@@ -30,7 +31,7 @@ import cx from 'classnames';
3031import { t } from '@apache-superset/core' ;
3132import { FeatureFlag , isFeatureEnabled , JsonObject } from '@superset-ui/core' ;
3233import { css , styled , SupersetTheme } from '@apache-superset/core/ui' ;
33- import { Icons , Constants } from '@superset-ui/core/components' ;
34+ import { Icons } from '@superset-ui/core/components' ;
3435import {
3536 Draggable ,
3637 Droppable ,
@@ -47,7 +48,6 @@ import { BACKGROUND_TRANSPARENT } from 'src/dashboard/util/constants';
4748import { isEmbedded } from 'src/dashboard/util/isEmbedded' ;
4849import { EMPTY_CONTAINER_Z_INDEX } from 'src/dashboard/constants' ;
4950import { isCurrentUserBot } from 'src/utils/isBot' ;
50- import { useDebouncedEffect } from '../../../../explore/exploreUtils' ;
5151
5252export type RowProps = {
5353 id : string ;
@@ -215,20 +215,13 @@ const Row = memo((props: RowProps) => {
215215 } ;
216216 } , [ ] ) ;
217217
218- useDebouncedEffect (
219- ( ) => {
220- const updatedHeight = containerRef . current ?. clientHeight ;
221- if (
222- editMode &&
223- containerRef . current &&
224- updatedHeight !== containerHeight
225- ) {
226- setContainerHeight ( updatedHeight ?? null ) ;
227- }
228- } ,
229- Constants . FAST_DEBOUNCE ,
230- [ editMode , containerHeight ] ,
231- ) ;
218+ useLayoutEffect ( ( ) => {
219+ if ( ! editMode ) return ;
220+ const updatedHeight = containerRef . current ?. clientHeight ;
221+ if ( updatedHeight !== undefined && updatedHeight !== containerHeight ) {
222+ setContainerHeight ( updatedHeight ) ;
223+ }
224+ } ) ;
232225
233226 const handleChangeFocus = useCallback ( ( nextFocus : boolean ) => {
234227 setIsFocused ( Boolean ( nextFocus ) ) ;
0 commit comments