8000 make ctrl+click work with most common clickable things · Issue #18788 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
make ctrl+click work with most common clickable things #18788
Closed
@ankush

Description

@ankush

Router ignores cmd/ctrl+click on A tags.

$("body").on("click", "a", function (e) {
let override = (route) => {
e.preventDefault();
frappe.set_route(route);
return false;
};
const target_element = e.currentTarget;
const href = target_element.getAttribute("href");
const is_on_same_host = target_element.hostname === window.location.hostname;
// click handled, but not by href
if (
target_element.getAttribute("onclick") || // has a handler
e.ctrlKey ||
e.metaKey || // open in a new tab
href === "#" // hash is home
) {
return;
}

But many places don't use a tags, and that causes inconsistent behavior and is bad for accessibility.

All of these are not following "link" conventions:

Ctrl+click should always just work.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0