react-data-grid
react-data-grid copied to clipboard
[Please, check this issue as fast as you can] Input loses its focus on row editing
Describe the bug
Currently grid allows us to edit only one cell, in my case I want to click on edit icon and render inputs for multiple editing. When I type something in input - it loses focus and rerenders.
To Reproduce
- Define 'editable' property in a row, make conditional rendering in formatter for example: formatter(props) { return props.row.editable ? ( <MemoizedEditor {...props} onClose={() => console.log('sdc')} /> ) : ( <>{props.row.assetType}</> ); },
export const Editor = ({ row, column, onRowChange }: EditorProps<Row>) => { return ( <Input value={row[column.key as keyof Row] as unknown as string} onChange={event => onRowChange({ ...row, [column.key]: event.target.value })} /> ); };
- Try to type characters in input
Link to code example:
Expected behavior
Environment
-
react-data-gridversion: latest -
react/react-domversion: latest
Additional context
https://user-images.githubusercontent.com/34775579/187216814-edad545e-9d9f-4631-aa2b-f56e2e1e919b.mov
I encounter the same issue
Please create a reproducible example.