diff --git a/www/src/components/Table/editors/TextEditor.tsx b/www/src/components/Table/editors/TextEditor.tsx index 97207e6df..ff64bbf95 100644 --- a/www/src/components/Table/editors/TextEditor.tsx +++ b/www/src/components/Table/editors/TextEditor.tsx @@ -1,4 +1,4 @@ -import { useRef, useEffect } from "react"; +import { useRef, useLayoutEffect } from "react"; import { EditorProps } from "react-data-grid"; import { makeStyles, createStyles, TextField } from "@material-ui/core"; @@ -47,7 +47,7 @@ export default function TextEditor({ row, column }: EditorProps) { const inputRef = useRef(null); - useEffect(() => { + useLayoutEffect(() => { return () => { const newValue = inputRef.current?.value; if (newValue !== undefined && updateCell) {