Skip to content

Commit 5f4ec46

Browse files
Merge pull request #14160 from ToolJet/fix-hotfix-table-cell-edit
[hotfix]: Fix on clicking on cell edit not selecting the row
2 parents 674d019 + d93a847 commit 5f4ec46

File tree

10 files changed

+14
-16
lines changed

10 files changed

+14
-16
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.20.2-lts
1+
3.20.3-lts

frontend/.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.20.2-lts
1+
3.20.3-lts

frontend/ee

Submodule ee updated from 7cfcb38 to 7d68e92

frontend/src/AppBuilder/WidgetManager/widgets/table.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ export const tableConfig = {
692692
visibility: { value: '{{true}}' },
693693
disabledState: { value: '{{false}}' },
694694
dynamicHeight: { value: `{{false}}` },
695+
selectRowOnCellEdit: { value: '{{false}}' },
695696
},
696697
events: [],
697698
styles: {

frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/Datepicker.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ export const DatepickerColumn = ({
279279
const _showOverlay =
280280
ref?.current &&
281281
textRef?.current &&
282-
(ref.current.clientWidth < textRef.current.offsetWidth ||
283-
ref.current.clientHeight < textRef.current.offsetHeight);
282+
(ref.current.clientWidth < textRef.current.offsetWidth || ref.current.clientHeight < textRef.current.offsetHeight);
284283

285284
return (
286285
<OverlayTrigger
@@ -317,9 +316,10 @@ export const DatepickerColumn = ({
317316
'theme-dark dark-theme': darkMode,
318317
})}
319318
selected={date}
320-
onChange={(date) => {
319+
onChange={(date, e) => {
321320
setIsInputFocused(false);
322321
handleDateChange(date);
322+
e.stopPropagation();
323323
}}
324324
value={isInputFocused ? inputValue : computeDateString(date)}
325325
dateFormat={!isDateSelectionEnabled && isTimeChecked ? 'HH:mm' : dateDisplayFormat}

frontend/src/AppBuilder/Widgets/NewTable/_components/TableData/_components/TableRow.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,11 @@ export const TableRow = ({
109109
return;
110110
}
111111

112-
if (
113-
isEditable ||
114-
(['rightActions', 'leftActions'].includes(cell.column.id) &&
115-
allowSelection &&
116-
(!selectRowOnCellEdit || row.getIsSelected()))
117-
) {
118-
// to avoid on click event getting propagating to row when td is editable or has action button and allowSelection is true and selectRowOnCellEdit is false
112+
if (isEditable && allowSelection && !selectRowOnCellEdit) {
119113
e.stopPropagation();
114+
fireEvent('onRowClicked');
120115
}
116+
121117
setExposedVariables({
122118
selectedCell: {
123119
columnName: cell.column.columnDef?.header,

frontend/src/AppBuilder/Widgets/NewTable/_stores/slices/initSlice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const createInitSlice = (set, get) => ({
6565
? true
6666
: false;
6767
state.components[id].properties.defaultSelectedRow = properties?.defaultSelectedRow ?? { id: 1 };
68-
state.components[id].properties.selectRowOnCellEdit = properties?.selectRowOnCellEdit ?? true;
68+
state.components[id].properties.selectRowOnCellEdit = properties?.selectRowOnCellEdit ?? false;
6969

7070
let serverSidePagination = properties.serverSidePagination ?? false;
7171
if (typeof serverSidePagination !== 'boolean') state.components[id].properties.serverSidePagination = false;

server/.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.20.2-lts
1+
3.20.3-lts

server/ee

Submodule ee updated from 6f50733 to fa84b28

server/src/modules/apps/services/widget-config/table.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ export const tableConfig = {
691691
visibility: { value: '{{true}}' },
692692
disabledState: { value: '{{false}}' },
693693
dynamicHeight: { value: `{{false}}` },
694+
selectRowOnCellEdit: { value: '{{false}}' },
694695
},
695696
events: [],
696697
styles: {

0 commit comments

Comments
 (0)