fix: console error while using TAB shortcut in grid (#16701)
This commit is contained in:
parent
9bec3480ed
commit
88992c6686
2 changed files with 2 additions and 2 deletions
|
|
@ -179,7 +179,7 @@ frappe.ui.form.Form = class FrappeForm {
|
|||
grid_shortcut_keys.forEach(row => {
|
||||
frappe.ui.keys.add_shortcut({
|
||||
shortcut: row.shortcut,
|
||||
page: this,
|
||||
page: this.page,
|
||||
description: __(row.description),
|
||||
ignore_inputs: true,
|
||||
condition: () => !this.is_new()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ frappe.ui.keys.add_shortcut = ({shortcut, action, description, page, target, con
|
|||
if (is_input_focused && !ignore_inputs) return;
|
||||
if (!condition()) return;
|
||||
|
||||
if (!page || page.wrapper.is(':visible')) {
|
||||
if (action && (!page || page.wrapper.is(':visible'))) {
|
||||
let prevent_default = action(e);
|
||||
// prevent default if true is explicitly returned
|
||||
// or nothing returned (undefined)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue