diff --git a/src/components/operations/index.tsx b/src/components/operations/index.tsx index 9f3a411..7a210db 100644 --- a/src/components/operations/index.tsx +++ b/src/components/operations/index.tsx @@ -1,4 +1,4 @@ -import { useMemo } from "react"; +import { ChangeEvent, useMemo } from "react"; import { Cog } from "lucide-react"; import { useSelector } from "react-redux"; import { twMerge } from "tailwind-merge"; @@ -7,7 +7,6 @@ import { store } from "@/store"; import { locationPlaceholder, setLocation, toggleControls } from "@/store/reducers/editor"; import { ISTKProps } from "@/types"; import { stateToJSON } from "@/utils"; -import { Body } from "../core"; import { default as ExportAction } from "./export-button"; import { default as GridSwitch } from "./grid-switch"; @@ -26,14 +25,8 @@ const Operations: React.FC = ({ const OperationTriggerIcon = operationTriggerIcon ?? Cog; - const onLocationChange = (e) => { - const location = e.target.innerText; - console.log(location); - if (!location) { - document.getElementById(ids.location).innerText = inputPlaceholder; - return store.dispatch(setLocation(inputPlaceholder)); - } - store.dispatch(setLocation(location)); + const onLocationChange = (e: ChangeEvent) => { + store.dispatch(setLocation(e.target.value)); }; const onExportJson = () => { @@ -56,20 +49,18 @@ const Operations: React.FC = ({ )} style={styles?.root?.properties} > - - {inputPlaceholder} - + onChange={onLocationChange} + />
{showGridSwitch && }