Skip to content

Commit b4a14f7

Browse files
authored
fix: editInputRefs assignment for select textfields (#1339)
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
1 parent de5b2b1 commit b4a14f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/material-react-table/src/components/inputs/MRT_EditCellTextField.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export const MRT_EditCellTextField = <TData extends MRT_RowData>({
110110
fullWidth
111111
inputRef={(inputRef) => {
112112
if (inputRef) {
113-
editInputRefs.current![column.id] = inputRef;
113+
editInputRefs.current![column.id] = isSelectEdit
114+
? inputRef.node
115+
: inputRef;
114116
if (textFieldProps.inputRef) {
115117
textFieldProps.inputRef = inputRef;
116118
}

0 commit comments

Comments
 (0)