Skip to content

Commit d9af38b

Browse files
maharshivpatelmergify[bot]
authored andcommitted
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. (cherry picked from commit 9aa5526)
1 parent 243cfa3 commit d9af38b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

frappe/public/js/frappe/form/grid_row.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -944,19 +944,21 @@ export default class GridRow {
944944
vertical = false;
945945
horizontal = false;
946946
})
947-
.on("click", function () {
947+
.on("click", function (event) {
948948
if (frappe.ui.form.editable_row !== me) {
949949
var out = me.toggle_editable_row();
950950
}
951951
var col = this;
952952
let first_input_field = $(col).find('input[type="Text"]:first');
953+
first_input_field.trigger("focus");
953954

954-
first_input_field.length && on_input_focus(first_input_field);
955+
if (event.pointerType == "touch") {
956+
first_input_field.length && on_input_focus(first_input_field);
955957

956-
first_input_field.trigger("focus");
957-
first_input_field.one("blur", () => (input_in_focus = false));
958+
first_input_field.one("blur", () => (input_in_focus = false));
958959

959-
first_input_field.data("fieldtype") == "Date" && handle_date_picker();
960+
first_input_field.data("fieldtype") == "Date" && handle_date_picker();
961+
}
960962

961963
return out;
962964
});

0 commit comments

Comments
 (0)