Skip to content

Commit c3949a9

Browse files
committed
Add comment
1 parent 67ed67a commit c3949a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/core/src/internal/data-grid-overlay-editor/data-grid-overlay-editor.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface DataGridOverlayEditorProps {
3636
readonly onFinishEditing: (newCell: GridCell | undefined, movement: readonly [-1 | 0 | 1, -1 | 0 | 1]) => void;
3737
readonly forceEditMode: boolean;
3838
readonly highlight: boolean;
39-
readonly portalElementRef?: React.RefObject<HTMLElement>
39+
readonly portalElementRef?: React.RefObject<HTMLElement>;
4040
readonly imageEditorOverride?: ImageEditorType;
4141
readonly getCellRenderer: GetCellRendererCallback;
4242
readonly markdownDivCreateNode?: (content: string) => DocumentFragment;
@@ -132,7 +132,12 @@ const DataGridOverlayEditor: React.FunctionComponent<DataGridOverlayEditorProps>
132132
event.stopPropagation();
133133
event.preventDefault();
134134
customMotion.current = [0, 0];
135-
} else if (event.key === "Enter" && !event.shiftKey) {
135+
} else if (
136+
event.key === "Enter" &&
137+
// The shift key is reserved for multi-line editing
138+
// to allow inserting new lines without closing the editor.
139+
!event.shiftKey
140+
) {
136141
event.stopPropagation();
137142
event.preventDefault();
138143
customMotion.current = [0, 1];

0 commit comments

Comments
 (0)