Skip to content

Commit 8a26978

Browse files
committed
bugfix: list scroll reset on the map click
1 parent 7f61ee0 commit 8a26978

File tree

1 file changed

+4
-0
lines changed
  • vis/js/templates/Geomap/HeightContainer

1 file changed

+4
-0
lines changed

vis/js/templates/Geomap/HeightContainer/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import { FC, PropsWithChildren } from "react";
22
import { useDispatch, useSelector } from "react-redux";
33

4+
import { useActiveDataItem } from "@/hooks";
45
import { deselectPaper } from "@/js/actions";
56

67
import { getMapHeight } from "./selectors";
78

89
export const HeightContainer: FC<PropsWithChildren> = ({ children }) => {
10+
const { selectedItemId } = useActiveDataItem();
911
const height = useSelector(getMapHeight);
1012
const dispatch = useDispatch();
1113

1214
const handleMapClick = () => {
15+
if (!selectedItemId) return;
16+
1317
dispatch(deselectPaper());
1418
};
1519

0 commit comments

Comments
 (0)