diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 94626f06a7..8d738019a5 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -1098,13 +1098,16 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { if ( $target.hasClass("filterable") || $target.hasClass("icon-heart") || - $target.is(":checkbox") || - $target.is("a") + $target.is(":checkbox") ) { e.stopPropagation(); return; } - // open form + + // link, let the event be handled via set_route + if ($target.is("a")) { return; } + + // clicked on the row, open form const $row = $(e.currentTarget); const link = $row.find(".list-subject a").get(0); if (link) { diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index f673f2e3d1..a4e8bc081f 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -24,9 +24,11 @@ $(window).on('hashchange', function() { } }); -window.addEventListener('popstate', () => { +window.addEventListener('popstate', (e) => { // forward-back button, just re-render based on current route frappe.router.route(); + e.preventDefault(); + return false; }); // routing v2, capture all clicks so that the target is managed with push-state