From 57114f5f6c966d07a69976b9800dd2772004e6ed Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 18 Nov 2024 15:11:07 +0000 Subject: [PATCH] Improved implementation --- src/components/DataSamplesTableRow.tsx | 27 +++++++------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/components/DataSamplesTableRow.tsx b/src/components/DataSamplesTableRow.tsx index f57ec4d99..8065eaee5 100644 --- a/src/components/DataSamplesTableRow.tsx +++ b/src/components/DataSamplesTableRow.tsx @@ -1,17 +1,16 @@ import { Box, GridItem, Text, useDisclosure } from "@chakra-ui/react"; import { FormattedMessage, useIntl } from "react-intl"; -import { ActionData } from "../model"; -import { useStore } from "../store"; -import DataSamplesTableHints from "./DataSamplesTableHints"; -import { ConfirmDialog } from "./ConfirmDialog"; -import ActionDataSamplesCard from "./ActionDataSamplesCard"; -import ActionNameCard from "./ActionNameCard"; import { ConnectionFlowStep, useConnectionStage, } from "../connection-stage-hooks"; +import { ActionData } from "../model"; +import { useStore } from "../store"; +import ActionDataSamplesCard from "./ActionDataSamplesCard"; +import ActionNameCard from "./ActionNameCard"; +import { ConfirmDialog } from "./ConfirmDialog"; +import DataSamplesTableHints from "./DataSamplesTableHints"; import { RecordingOptions } from "./RecordingDialog"; -import { useEffect, useRef } from "react"; interface DataSamplesTableRowProps { action: ActionData; @@ -36,18 +35,6 @@ const DataSamplesTableRow = ({ const deleteConfirmDisclosure = useDisclosure(); const deleteAction = useStore((s) => s.deleteAction); const { stage } = useConnectionStage(); - const rowRef = useRef(null); - - useEffect(() => { - let rowRefValue: HTMLElement | undefined; - if (rowRef.current) { - rowRef.current.addEventListener("focusin", onSelectRow); - rowRefValue = rowRef.current; - } - return () => { - rowRefValue?.removeEventListener("focusin", onSelectRow); - }; - }, [onSelectRow]); return ( <> @@ -72,7 +59,7 @@ const DataSamplesTableRow = ({ onConfirm={() => deleteAction(action.ID)} onCancel={deleteConfirmDisclosure.onClose} /> - +