Skip to content

Commit

Permalink
fix: editInputRefs assignment for select textfields (#1339)
Browse files Browse the repository at this point in the history
When the edit cell textfield is configured as a select the ref returns an object with a node property that holds the input element as value.

Therefore the assignment is adjusted with a condition to get the input element correct.

Fixes: #1245
  • Loading branch information
fredericbahr authored Dec 22, 2024
1 parent de5b2b1 commit b4a14f7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const MRT_EditCellTextField = <TData extends MRT_RowData>({
fullWidth
inputRef={(inputRef) => {
if (inputRef) {
editInputRefs.current![column.id] = inputRef;
editInputRefs.current![column.id] = isSelectEdit
? inputRef.node
: inputRef;
if (textFieldProps.inputRef) {
textFieldProps.inputRef = inputRef;
}
Expand Down

0 comments on commit b4a14f7

Please sign in to comment.