Skip to content

The open alternative to Salesforce, designed for AI.

fix: prevent LinkAvatarChip from triggering page reload when table cells or inline cells are in edit mode (#12734)

Naiferf5835a77e591
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx
index d51a7918035..56f0205d3c2 100644
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCell.tsx
@@ -136,7 +136,7 @@ export const RecordInlineCell = ({
if (hotkeyScope.scope !== DEFAULT_CELL_SCOPE.scope) {
return;
}
-
+ event.preventDefault();
event.stopImmediatePropagation();
persistField();
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPicker.tsx
index 0634fc44fdc..53e9c58fe01 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPicker.tsx
@@ -55,6 +55,7 @@ export const SingleRecordPicker = ({
useListenClickOutside({
refs: [containerRef],
callback: (event) => {
+ event.preventDefault();
event.stopImmediatePropagation();
const weAreNotInAnHTMLInput = !(
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFieldInput.tsx
index e60e79f1734..6b5720b7a02 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFieldInput.tsx
@@ -41,8 +41,8 @@ export const RecordTableCellFieldInput = () => {
if (hotkeyScope.scope !== TableHotkeyScope.CellEditMode) {
return;
}
+ event.preventDefault();
event.stopImmediatePropagation();
-
persistField();
onCloseTableCell();
},
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/DateInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/DateInput.tsx
index 123ea1ddb00..8f0086cc142 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/DateInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/DateInput.tsx
@@ -90,14 +90,12 @@ export const DateInput = ({
if (hotkeyScope?.scope === TableHotkeyScope.CellEditMode) {
closeDropdownYearSelect(MONTH_AND_YEAR_DROPDOWN_YEAR_SELECT_ID);
closeDropdownMonthSelect(MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID);
- onEscape(internalValue);
onClickOutside(event, internalValue);
}
},
[
closeDropdownYearSelect,
closeDropdownMonthSelect,
- onEscape,
onClickOutside,
internalValue,
],
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
index fd5931c72f4..00a6ef1a5c2 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
@@ -89,7 +89,7 @@ export const MultiSelectInput = ({
refs: [containerRef],
callback: (event) => {
event.stopImmediatePropagation();
-
+ event.preventDefault();
const weAreNotInAnHTMLInput = !(
event.target instanceof HTMLInputElement &&
event.target.tagName === 'INPUT'
diff --git a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
index d1b138a53b1..edc7d64f9cf 100644
--- a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
@@ -86,7 +86,7 @@ export const SelectInput = ({
refs: [containerRef],
callback: (event) => {
event.stopImmediatePropagation();
-
+ event.preventDefault();
const weAreNotInAnHTMLInput = !(
event.target instanceof HTMLInputElement &&
event.target.tagName === 'INPUT'