Skip to content

Commit

Permalink
TextEditor: fix values not saving in react 17
Browse files Browse the repository at this point in the history
  • Loading branch information
notsidney committed Jul 5, 2021
1 parent 154be1e commit 19aff5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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";
Expand Down Expand Up @@ -47,7 +47,7 @@ export default function TextEditor({ row, column }: EditorProps<any>) {

const inputRef = useRef<HTMLInputElement>(null);

useEffect(() => {
useLayoutEffect(() => {
return () => {
const newValue = inputRef.current?.value;
if (newValue !== undefined && updateCell) {
Expand Down

0 comments on commit 19aff5f

Please sign in to comment.