Skip to content

Commit 4cbcd7a

Browse files
authored
Merge pull request #4516 from azmy60/fix/edit-and-selectrange-conflict
fix navigation conflict with SelectRange and Edit
2 parents 9a80c47 + 29c4bce commit 4cbcd7a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/js/modules/Edit/Edit.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ export default class Edit extends Module{
6969
this.subscribe("data-refreshing", this.cancelEdit.bind(this));
7070
this.subscribe("clipboard-paste", this.pasteBlocker.bind(this));
7171

72-
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
73-
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));
74-
75-
// this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
76-
// this.subscribe("keybinding-nav-right", this.navigateRight.bind(this, undefined));
77-
this.subscribe("keybinding-nav-up", this.navigateUp.bind(this, undefined));
78-
this.subscribe("keybinding-nav-down", this.navigateDown.bind(this, undefined));
72+
if (!this.confirm("edit-nav-disabled")) {
73+
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
74+
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));
75+
76+
// this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
77+
// this.subscribe("keybinding-nav-right", this.navigateRight.bind(this, undefined));
78+
this.subscribe("keybinding-nav-up", this.navigateUp.bind(this, undefined));
79+
this.subscribe("keybinding-nav-down", this.navigateDown.bind(this, undefined));
80+
}
7981

8082
if(Object.keys(this.table.options).includes("editorEmptyValue")){
8183
this.convertEmptyValues = true;

src/js/modules/SelectRange/SelectRange.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export default class SelectRange extends Module {
6666
console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.");
6767
}
6868
}
69+
70+
this.subscribe("edit-nav-disabled", () => {
71+
return true; // Disable navigation in edit module
72+
});
6973
}
7074

7175

@@ -142,12 +146,6 @@ export default class SelectRange extends Module {
142146
if(this.columnSelection && column.definition.headerSort && this.options("headerSortClickElement") !== "icon"){
143147
console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.");
144148
}
145-
146-
if (column.modules.edit) {
147-
// Block editor from taking action so we can trigger edit by
148-
// double clicking.
149-
// column.modules.edit.blocked = true;
150-
}
151149
}
152150

153151
updateHeaderColumn(){

0 commit comments

Comments
 (0)