Skip to content

fix navigation conflict with SelectRange and Edit #4516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/js/modules/Edit/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ export default class Edit extends Module{
this.subscribe("data-refreshing", this.cancelEdit.bind(this));
this.subscribe("clipboard-paste", this.pasteBlocker.bind(this));

this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));

// this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
// this.subscribe("keybinding-nav-right", this.navigateRight.bind(this, undefined));
this.subscribe("keybinding-nav-up", this.navigateUp.bind(this, undefined));
this.subscribe("keybinding-nav-down", this.navigateDown.bind(this, undefined));
if (!this.confirm("edit-nav-disabled")) {
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));

// this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
// this.subscribe("keybinding-nav-right", this.navigateRight.bind(this, undefined));
this.subscribe("keybinding-nav-up", this.navigateUp.bind(this, undefined));
this.subscribe("keybinding-nav-down", this.navigateDown.bind(this, undefined));
}

if(Object.keys(this.table.options).includes("editorEmptyValue")){
this.convertEmptyValues = true;
Expand Down
10 changes: 4 additions & 6 deletions src/js/modules/SelectRange/SelectRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default class SelectRange extends Module {
console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.");
}
}

this.subscribe("edit-nav-disabled", () => {
return true; // Disable navigation in edit module
});
}


Expand Down Expand Up @@ -141,12 +145,6 @@ export default class SelectRange extends Module {
if(this.columnSelection && column.definition.headerSort && this.options("headerSortClickElement") !== "icon"){
console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.");
}

if (column.modules.edit) {
// Block editor from taking action so we can trigger edit by
// double clicking.
// column.modules.edit.blocked = true;
}
}

updateHeaderColumn(){
Expand Down
Loading