Skip to content

Commit

Permalink
fix: child table don't run mobile specific code
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 9aa5526)
  • Loading branch information
maharshivpatel authored and mergify[bot] committed Nov 4, 2022
1 parent 243cfa3 commit d9af38b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frappe/public/js/frappe/form/grid_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.trigger("focus");

first_input_field.length && on_input_focus(first_input_field);
if (event.pointerType == "touch") {
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.one("blur", () => (input_in_focus = false));

first_input_field.data("fieldtype") == "Date" && handle_date_picker();
first_input_field.data("fieldtype") == "Date" && handle_date_picker();
}

return out;
});
Expand Down

0 comments on commit d9af38b

Please sign in to comment.