diff --git a/src/components/dom.ts b/src/components/dom.ts index 573c2d98..2f67e49a 100644 --- a/src/components/dom.ts +++ b/src/components/dom.ts @@ -572,7 +572,7 @@ export default class Dom { * @param element - element to check * @returns {HTMLAnchorElement | null} */ - public static getAnchor(element: Element): HTMLAnchorElement | null { + public static getClosestAnchor(element: Element): HTMLAnchorElement | null { return element.closest("a"); } diff --git a/src/components/modules/ui.ts b/src/components/modules/ui.ts index 708592df..d8dc3798 100644 --- a/src/components/modules/ui.ts +++ b/src/components/modules/ui.ts @@ -773,7 +773,7 @@ export default class UI extends Module { */ const element = event.target as Element; const ctrlKey = event.metaKey || event.ctrlKey; - const anchor = $.getAnchor(element); + const anchor = $.getClosestAnchor(element); if (anchor && ctrlKey) { event.stopImmediatePropagation();