Skip to content

Commit

Permalink
climbing: Disable double click in routelist (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik authored Mar 25, 2024
1 parent 0fdf50c commit d951538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const ExpandedRow = ({
onClick={onNodeDetailClick}
color="secondary"
size="small"
variant="contained"
variant="text"
endIcon={<ArrowForwardIcon />}
>
Show route detail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,8 +85,6 @@ export const RouteListDndContent = ({ isEditable }) => {
isRouteSelected,
isEditMode,
getMachine,
setRoutesExpanded,
routesExpanded,
} = useClimbingContext();
const [items, setItems] = useState([]);
const machine = getMachine();
Expand Down Expand Up @@ -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);
}}
>
<MaxWidthContainer>
Expand Down

0 comments on commit d951538

Please sign in to comment.