fix: console error while using TAB shortcut in grid (#16701)

This commit is contained in:
Max Solanki 2022-04-27 17:08:26 +05:30 committed by GitHub
parent 9bec3480ed
commit 88992c6686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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()

View file

@ -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)