From 8145c4e147c4db04d3f0fa45c0496ba00962fcff Mon Sep 17 00:00:00 2001 From: Zhen Date: Fri, 1 Nov 2024 13:03:49 -0400 Subject: [PATCH] update useEditableText.ts --- .../src/editable/useEditableText.ts | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/vuu-ui/packages/vuu-ui-controls/src/editable/useEditableText.ts b/vuu-ui/packages/vuu-ui-controls/src/editable/useEditableText.ts index eccb315cf..3a0e8aa25 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/editable/useEditableText.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/editable/useEditableText.ts @@ -1,14 +1,12 @@ import { DataValueValidationChecker } from "@finos/vuu-data-types"; -import { DataItemEditHandler } from "@finos/vuu-table-types"; -import { getTypedValue } from "@finos/vuu-utils"; import { VuuRowDataItemType } from "@finos/vuu-protocol-types"; -import { dispatchCustomEvent } from "@finos/vuu-utils"; +import { DataItemEditHandler } from "@finos/vuu-table-types"; +import { dispatchCustomEvent, getTypedValue } from "@finos/vuu-utils"; import { FocusEventHandler, FormEventHandler, KeyboardEvent, useCallback, - useMemo, useRef, useState, } from "react"; @@ -37,16 +35,16 @@ export const useEditableText = ({ const [editState, setEditState] = useState({ value: value?.toString() ?? "", }); - console.log("edit state: ", editState); + // console.log("edit state: ", editState); const initialValueRef = useRef(value?.toString() ?? ""); const isDirtyRef = useRef(false); - useMemo(() => { - if (editState.value !== value?.toString()) { - setEditState({ message: "", value: value?.toString() ?? "" }); - console.log("initial value changed to: ", value); - } - }, [editState.value, value]); + // useMemo(() => { + // if (editState.value !== value?.toString()) { + // setEditState({ message: "", value: value?.toString() ?? "" }); + // console.log("initial value changed to: ", value); + // } + // }, [editState.value, value]); const commit = useCallback( async (target: HTMLElement) => {