Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit e11265a

Browse files
authored
fix: LSDV-5202: Fix Ranker d-n-d in Preview (#1421)
There was a problem with ResizeObserver from our panels, when user moved item to another column making it higher. That happens only in collapsed mode, and ResizeObserver is actually not needed there.
1 parent bb2acdc commit e11265a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/SidePanels/SidePanels.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ const SidePanelsComponent: FC<SidePanelsProps> = ({
405405
const observer = new ResizeObserver(() => {
406406
const { clientWidth, clientHeight } = root ?? {};
407407

408+
// we don't need to check or resize anything in collapsed state
409+
if (clientWidth <= maxWindowWidth) return;
410+
408411
// Remember current width and height of the viewport
409412
viewportSize.current.width = clientWidth ?? 0;
410413
viewportSize.current.height = clientHeight ?? 0;

src/components/SidePanels/TabPanels/SideTabsPanels.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ const SideTabsPanelsComponent: FC<SidePanelsProps> = ({
389389

390390
const observer = new ResizeObserver(() => {
391391
const { clientWidth, clientHeight } = root ?? {};
392-
392+
393+
// we don't need to check or resize anything in collapsed state
394+
if (clientWidth <= maxWindowWidth) return;
395+
393396
if(viewportSize.current.height !== clientHeight) setPanelData(getSnappedHeights(panelData, clientHeight));
394397
// Remember current width and height of the viewport
395398
viewportSize.current.width = clientWidth ?? 0;

0 commit comments

Comments
 (0)