From 9aa55263053ea07a5ecd9e2127ed63eadced9b53 Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Fri, 4 Nov 2022 12:07:39 +0530 Subject: [PATCH] fix: child table don't run mobile specific code on_input_focus & handle_date_picker function has mobile specific code that relies on touch inputs so there is no need to run it on desktop. --- frappe/public/js/frappe/form/grid_row.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frappe/public/js/frappe/form/grid_row.js b/frappe/public/js/frappe/form/grid_row.js index 4a30ad68e0..f9f09187bc 100644 --- a/frappe/public/js/frappe/form/grid_row.js +++ b/frappe/public/js/frappe/form/grid_row.js @@ -944,19 +944,21 @@ export default class GridRow { vertical = false; horizontal = false; }) - .on("click", function () { + .on("click", function (event) { if (frappe.ui.form.editable_row !== me) { var out = me.toggle_editable_row(); } var col = this; let first_input_field = $(col).find('input[type="Text"]:first'); - - first_input_field.length && on_input_focus(first_input_field); - first_input_field.trigger("focus"); - first_input_field.one("blur", () => (input_in_focus = false)); - first_input_field.data("fieldtype") == "Date" && handle_date_picker(); + if (event.pointerType == "touch") { + first_input_field.length && on_input_focus(first_input_field); + + first_input_field.one("blur", () => (input_in_focus = false)); + + first_input_field.data("fieldtype") == "Date" && handle_date_picker(); + } return out; });