Close dialog when clicked on link (#16690)

This commit is contained in:
Bram Kragten
2023-05-31 14:01:47 +02:00
committed by GitHub
parent 046475e7ac
commit 585db6ab3f
3 changed files with 25 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
export const isNavigationClick = (e: MouseEvent) => {
export const isNavigationClick = (e: MouseEvent, preventDefault = true) => {
// Taken from polymer/pwa-helpers. BSD-3 licensed
if (
e.defaultPrevented ||
@@ -40,6 +40,8 @@ export const isNavigationClick = (e: MouseEvent) => {
return undefined;
}
e.preventDefault();
if (preventDefault) {
e.preventDefault();
}
return href;
};