Skip to content

Commit 98d74bd

Browse files
committed
fix: set initialPopoverLabel where not visible
1 parent 25c1987 commit 98d74bd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ const ColumnSelectPopoverTriggerInner = ({
9292
initialPopoverLabel = editedColumn.label || defaultPopoverLabel;
9393
}
9494

95-
useEffect(() => {
96-
setPopoverLabel(initialPopoverLabel);
97-
}, [initialPopoverLabel, popoverVisible]);
98-
9995
const togglePopover = useCallback((visible: boolean) => {
10096
setPopoverVisible(visible);
10197
}, []);
@@ -121,6 +117,13 @@ const ColumnSelectPopoverTriggerInner = ({
121117
setIsTitleEditDisabled(tab !== editableTitleTab);
122118
}, []);
123119

120+
useEffect(() => {
121+
if (!visible) {
122+
setPopoverLabel(initialPopoverLabel);
123+
setHasCustomLabel(false);
124+
}
125+
}, [initialPopoverLabel, visible]);
126+
124127
const overlayContent = useMemo(
125128
() => (
126129
<ExplorePopoverContent>

0 commit comments

Comments
 (0)