Merge pull request #34286 from sokumon/dialog-issue

fix: check if the current route actually exists
This commit is contained in:
Soham Kulkarni 2025-10-06 22:29:04 +05:30 committed by GitHub
commit fd57f4869f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -249,7 +249,10 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
show() {
// show it
this.handle_focus();
if (window.location.pathname.startsWith("/app")) {
this.handle_focus();
}
if (this.animate) {
this.$wrapper.addClass("fade");
} else {
@ -279,7 +282,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
handle_focus() {
const me = this;
if (frappe.get_route) {
if (frappe.get_route()) {
if (frappe.get_route()[0] == "Form") {
if (!me.last_focus) me.last_focus = document.activeElement;
}