Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): prevent default canvas cell event to avoid adding space to the end of the cell

Ramesh Mane6d5fac9c2581
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/cells/AILongText.ts b/packages/nc-gui/components/smartsheet/grid/canvas/cells/AILongText.ts
index ea6d6c5a58..ff178dca39 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/cells/AILongText.ts
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/cells/AILongText.ts
@@ -323,6 +323,11 @@ export const AILongTextCellRenderer: CellRenderer = {
return true
}
+ if (isExpandCellKey(e)) {
+ // prevent default to avoid adding space to the end of the cell
+ e.preventDefault()
+ }
+
if (e.key.length === 1) {
makeCellEditable(row, column)
return true
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/cells/LongText.ts b/packages/nc-gui/components/smartsheet/grid/canvas/cells/LongText.ts
index a9a4bd22a0..2e63ec93f0 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/cells/LongText.ts
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/cells/LongText.ts
@@ -161,6 +161,9 @@ export const LongTextCellRenderer: CellRenderer = {
}
if (isExpandCellKey(e)) {
+ // prevent default to avoid adding space to the end of the cell
+ e.preventDefault()
+
makeCellEditable(row, column)
return true
}