fix: setup wizard auto completes when clickin on autocomplete fields

closes https://github.com/frappe/frappe/issues/15693
This commit is contained in:
Ankush Menat 2023-07-02 12:50:43 +05:30
parent 2aec7ac579
commit 1a7cb47826

View file

@ -97,10 +97,13 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
handle_enter_press(e) {
if (e.which === frappe.ui.keyCode.ENTER) {
var $target = $(e.target);
if ($target.hasClass("prev-btn")) {
let $target = $(e.target);
if ($target.hasClass("prev-btn") || $target.hasClass("next-btn")) {
$target.trigger("click");
} else {
// hitting enter on autocomplete field shouldn't trigger next slide.
if ($target.data().fieldtype == "Autocomplete") return;
this.container.find(".next-btn").trigger("click");
e.preventDefault();
}