diff --git a/packages/grid/src/components/cell-editors/text/text-editor.component.ts b/packages/grid/src/components/cell-editors/text/text-editor.component.ts index 373b2f2b..84034f9e 100644 --- a/packages/grid/src/components/cell-editors/text/text-editor.component.ts +++ b/packages/grid/src/components/cell-editors/text/text-editor.component.ts @@ -15,7 +15,7 @@ import { AbstractEditCellEditor } from '../abstract-cell-editor.component'; [thyAutofocus]="autoFocus()" [(ngModel)]="modelValue" (ngModelChange)="valueChange()" - (thyEnter)="updateValue()" + (thyEnter)="onEnter($event)" (blur)="updateValue()" thySize="lg" > @@ -61,6 +61,14 @@ export class TextCellEditorComponent extends AbstractEditCellEditor impl this.updateStyle(); } + onEnter(event: KeyboardEvent) { + if (event.shiftKey) { + return; + } + event.preventDefault(); + this.updateValue(); + } + updateValue() { super.update(); this.closePopover(); diff --git a/packages/grid/src/renderer/components/cells/single-text.component.ts b/packages/grid/src/renderer/components/cells/single-text.component.ts index 605dae28..02e28332 100644 --- a/packages/grid/src/renderer/components/cells/single-text.component.ts +++ b/packages/grid/src/renderer/components/cells/single-text.component.ts @@ -151,7 +151,6 @@ export class AITableCellText extends CoverCellBase { ...text, height: text.height + AI_TABLE_CELL_PADDING + AI_TABLE_CELL_LINE_BORDER }; - }); textMaxWidth = computed(() => { @@ -165,6 +164,9 @@ export class AITableCellText extends CoverCellBase { if (isUndefinedOrNull(textRender)) { return; } + if (this.isExpand()) { + return textRender.replace(/\r\n|\r/g, '\n'); + } return textRender.replace(/\r|\n/g, ' '); }); @@ -217,7 +219,6 @@ export class AITableCellText extends CoverCellBase { ellipsis: false, zIndex }; - } return; });