Skip to content

Commit

Permalink
Allow new lines to be entered when editing textareas (#633)
Browse files Browse the repository at this point in the history
Previously, new lines could not be entered when using textareas for the
textfield component (i.e setting multiline: true on
the muiEditTextFieldProps prop). This change allows the user to enter
new lines when using textareas.
  • Loading branch information
domenicomanna committed Jul 19, 2023
1 parent 935c95d commit fb333cf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const MRT_EditCellTextField = <TData extends Record<string, any>>({

const handleEnterKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
textFieldProps.onKeyDown?.(event);
if (event.key === 'Enter') {
if (event.key === 'Enter' && !event.shiftKey) {
editInputRefs.current[column.id]?.blur();
}
};
Expand Down

0 comments on commit fb333cf

Please sign in to comment.