Skip to content

Commit 19aff5f

Browse files
committed
TextEditor: fix values not saving in react 17
(thanks @oliviertassinari ) mui/material-ui#25560 (comment) facebook/react#17925
1 parent 154be1e commit 19aff5f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

www/src/components/Table/editors/TextEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRef, useEffect } from "react";
1+
import { useRef, useLayoutEffect } from "react";
22
import { EditorProps } from "react-data-grid";
33

44
import { makeStyles, createStyles, TextField } from "@material-ui/core";
@@ -47,7 +47,7 @@ export default function TextEditor({ row, column }: EditorProps<any>) {
4747

4848
const inputRef = useRef<HTMLInputElement>(null);
4949

50-
useEffect(() => {
50+
useLayoutEffect(() => {
5151
return () => {
5252
const newValue = inputRef.current?.value;
5353
if (newValue !== undefined && updateCell) {

0 commit comments

Comments
 (0)