fix: flicker issue when both the min max values collide (#18547)
This commit is contained in:
parent
04ed5329a1
commit
11dfa2c8e1
|
|
@ -159,6 +159,9 @@ const AutoHeightOverlay: React.FC<AutoHeightOverlayProps> = memo(
|
||||||
const finalMinY = minY + mindY;
|
const finalMinY = minY + mindY;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// reset the diff on backend update
|
||||||
|
setMindY(0);
|
||||||
|
setMaxdY(0);
|
||||||
setMaxY(maxDynamicHeight * GridDefaults.DEFAULT_GRID_ROW_HEIGHT);
|
setMaxY(maxDynamicHeight * GridDefaults.DEFAULT_GRID_ROW_HEIGHT);
|
||||||
}, [maxDynamicHeight]);
|
}, [maxDynamicHeight]);
|
||||||
|
|
||||||
|
|
@ -220,8 +223,6 @@ const AutoHeightOverlay: React.FC<AutoHeightOverlayProps> = memo(
|
||||||
|
|
||||||
if (heightToSet === minY + mindY) {
|
if (heightToSet === minY + mindY) {
|
||||||
batchUpdate(heightToSet);
|
batchUpdate(heightToSet);
|
||||||
setMindY(0);
|
|
||||||
setMaxdY(0);
|
|
||||||
} else {
|
} else {
|
||||||
updateMaxHeight(heightToSet);
|
updateMaxHeight(heightToSet);
|
||||||
setMaxdY(0);
|
setMaxdY(0);
|
||||||
|
|
@ -231,6 +232,9 @@ const AutoHeightOverlay: React.FC<AutoHeightOverlayProps> = memo(
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// reset the diff on backend update
|
||||||
|
setMindY(0);
|
||||||
|
setMaxdY(0);
|
||||||
setMinY(minDynamicHeight * GridDefaults.DEFAULT_GRID_ROW_HEIGHT);
|
setMinY(minDynamicHeight * GridDefaults.DEFAULT_GRID_ROW_HEIGHT);
|
||||||
}, [minDynamicHeight]);
|
}, [minDynamicHeight]);
|
||||||
|
|
||||||
|
|
@ -258,8 +262,6 @@ const AutoHeightOverlay: React.FC<AutoHeightOverlayProps> = memo(
|
||||||
|
|
||||||
if (heightToSet === maxY + maxdY) {
|
if (heightToSet === maxY + maxdY) {
|
||||||
batchUpdate(heightToSet);
|
batchUpdate(heightToSet);
|
||||||
setMindY(0);
|
|
||||||
setMaxdY(0);
|
|
||||||
} else {
|
} else {
|
||||||
updateMinHeight(heightToSet);
|
updateMinHeight(heightToSet);
|
||||||
setMindY(0);
|
setMindY(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user