From 61d6d71e8cecc965c25ae0b5519bb470e003a286 Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Mon, 25 Jun 2018 13:11:15 +0200 Subject: [PATCH] Fix right mouse click on in firefox (#1010) * Check if the left mouse is pressed * using button instead of which --- .../src/Services/UriHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/UriHelper.ts b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/UriHelper.ts index 734fe80a24..c4e8fcbf1b 100644 --- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/UriHelper.ts +++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/UriHelper.ts @@ -22,7 +22,7 @@ registerFunction(`${registeredFunctionPrefix}.enableNavigationInterception`, () // We must explicitly check if it has an 'href' attribute, because if it doesn't, the result might be null or an empty string depending on the browser const anchorTarget = findClosestAncestor(event.target as Element | null, 'A') as HTMLAnchorElement; const hrefAttributeName = 'href'; - if (anchorTarget && anchorTarget.hasAttribute(hrefAttributeName)) { + if (anchorTarget && anchorTarget.hasAttribute(hrefAttributeName) && event.button === 0) { const href = anchorTarget.getAttribute(hrefAttributeName)!; const absoluteHref = toAbsoluteUri(href);