From d951538f7bc2c48ded8a78068f4d438de4e9cf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20V=C3=A1clav=C3=ADk?= Date: Mon, 25 Mar 2024 06:55:58 +0100 Subject: [PATCH] climbing: Disable double click in routelist (#282) --- .../Climbing/RouteList/ExpandedRow.tsx | 2 +- .../Climbing/RouteList/RouteListDndContent.tsx | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/FeaturePanel/Climbing/RouteList/ExpandedRow.tsx b/src/components/FeaturePanel/Climbing/RouteList/ExpandedRow.tsx index ebee73ec2..8ba7ecbe4 100644 --- a/src/components/FeaturePanel/Climbing/RouteList/ExpandedRow.tsx +++ b/src/components/FeaturePanel/Climbing/RouteList/ExpandedRow.tsx @@ -173,7 +173,7 @@ export const ExpandedRow = ({ onClick={onNodeDetailClick} color="secondary" size="small" - variant="contained" + variant="text" endIcon={} > Show route detail diff --git a/src/components/FeaturePanel/Climbing/RouteList/RouteListDndContent.tsx b/src/components/FeaturePanel/Climbing/RouteList/RouteListDndContent.tsx index 87acb53b4..0ecff976c 100644 --- a/src/components/FeaturePanel/Climbing/RouteList/RouteListDndContent.tsx +++ b/src/components/FeaturePanel/Climbing/RouteList/RouteListDndContent.tsx @@ -3,7 +3,6 @@ import React, { useEffect, useState } from 'react'; import DragIndicatorIcon from '@material-ui/icons/DragIndicator'; import { useClimbingContext } from '../contexts/ClimbingContext'; import { RenderListRow } from './RouteListRow'; -import { toggleElementInArray } from '../utils/array'; type Item = { id: number; @@ -86,8 +85,6 @@ export const RouteListDndContent = ({ isEditable }) => { isRouteSelected, isEditMode, getMachine, - setRoutesExpanded, - routesExpanded, } = useClimbingContext(); const [items, setItems] = useState([]); const machine = getMachine(); @@ -222,15 +219,8 @@ export const RouteListDndContent = ({ isEditable }) => { onDragOver={(e) => handleDragOver(e, index)} onDragEnd={handleDragEnd} isSelected={isSelected} - onClick={(event) => { - const isDoubleClick = event.detail === 2; - if (isDoubleClick) { - setRoutesExpanded( - toggleElementInArray(routesExpanded, index), - ); - } else { - onRowClick(index); - } + onClick={() => { + onRowClick(index); }} >