Skip to content

Fix @OnClick:preventDefault not being respected by Blazor enhanced navigation - #70299

Closed
Yuvan111 wants to merge 10 commits into
dotnet:mainfrom
Yuvan111:fix-52514-predef-Nav
Closed

Yuvan111 wants to merge 10 commits into
dotnet:mainfrom
Yuvan111:fix-52514-predef-Nav

Merge branch 'main' into fix-52514-predef-Nav

a1e162e
Select commit
Loading
Failed to load commit list.
Azure Pipelines / aspnetcore-components-e2e succeeded Nov 17, 2026 in 1h 3m 41s

Build #20261116.77 had test failures

Details

Tests

  • Failed: 1 (0.04%)
  • Passed: 2,657 (99.77%)
  • Other: 5 (0.19%)
  • Total: 2,663

Annotations

Check failure on line 248 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-components-e2e

Build log #L248

Bash exited with code '1'.

Check failure on line 1 in Microsoft.AspNetCore.Components.E2ETests.ServerRenderingTests.RedirectionTest.NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException

See this annotation in the file changed.

@azure-pipelines azure-pipelines / aspnetcore-components-e2e

Microsoft.AspNetCore.Components.E2ETests.ServerRenderingTests.RedirectionTest.NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException

OpenQA.Selenium.BrowserAssertFailedException : Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 0
Actual:   3
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 154
   at Microsoft.AspNetCore.E2ETesting.WaitAssert.<>c__DisplayClass23_0`1.<WaitAssertCore>b__0(IWebDriver _) in /mnt/vss/_work/1/s/src/Shared/E2ETesting/WaitAssert.cs:line 129
Browser URL: http://127.0.0.1:41133/subdir/redirect/circular
Screen shot captured at '/mnt/vss/_work/1/s/src/Components/test/E2ETest/bin/screenshots/eab05f5d6d014e7ab3875310d778eea4.png'
Encountered browser errors
[2026-11-17T06:33:53Z] [Warning] http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.js 0:60418 "[2026-11-17T06:33:53.203Z] Warning: Initializer 'http://127.0.0.1:41133/subdir/BasicTestApp.vpc4xa0l6h.lib.module.js' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead."
[2026-11-17T06:33:53Z] [Warning] http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.js 0:60418 "[2026-11-17T06:33:53.204Z] Warning: Initializer 'http://127.0.0.1:41133/subdir/JSInitializers/Classic/BasicTestApp.j2kfp6tx1s.lib.module.js' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead."
[2026-11-17T06:33:53Z] [Warning] http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.js 0:60418 "[2026-11-17T06:33:53.394Z] Warning: Initializer 'http://127.0.0.1:41133/subdir/BasicTestApp.vpc4xa0l6h.lib.module.js' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead."
[2026-11-17T06:33:53Z] [Warning] http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.js 0:60418 "[2026-11-17T06:33:53.399Z] Warning: Initializer 'http://127.0.0.1:41133/subdir/JSInitializers/Classic/BasicTestApp.j2kfp6tx1s.lib.module.js' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead."
Network responses (_framework, _blazor, and errors):
  [200] text/javascript - http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.js
  [200] text/javascript - http://127.0.0.1:41133/subdir/_framework/blazor.web.p8lbw2ucqh.jsPage content:
<head><meta charset="utf-8">
    <base href="/subdir/">
    </head>
<body><nav><a href="nav">Home</a> |
    <a href="streaming">Streaming</a> |
    <a href="large-streaming">Large Streaming</a> |
    <a href="streaming-interactivity">Streaming with interactivity</a> |
    <a href="nav/give-404-with-content">Error page with 404 content</a> |
    <a href="nav/nonexistent-page">Error page with no content</a> |
    <a href="nav/non-html-response">Non-HTML page</a> |
    <a href="nav/non-blazor-html-response">Non-Blazor HTML page</a> |
    <a href="nav/scroll-to-hash#some-content">Scroll to hash</a> |
    <a href="nav/throw-while-streaming">Error while streaming</a> |
    <a href="nav/interactive-component-navigation/server">Interactive component navigation (server)</a> |
    <a href="nav/interactive-component-navigation/webassembly">Interactive component navigation (webassembly)</a> |
    <a href="nav/list-headers">List headers</a> |
    <a href="nav/preserve-content">Preserve content</a>
    <span data-enhance-nav="false"><a href="nav/other"><span id="not-enhanced-nav-link">Other (no enhanced nav)</span></a> |
        <span data-enhance-nav=""><a href="nav/other">Other (re-enabled enhanced nav)</a> |
        </span></span>
    <a href="nav/location-changed/server">LocationChanged/LocationChanging event (server)</a>
    <a href="nav/location-changed/wasm">LocationChanged/LocationChanging event (wasm)</a>
    <a href="nav/location-changed/server-and-wasm">LocationChanged/LocationChanging event (server-and-was
Raw output
   at Microsoft.AspNetCore.E2ETesting.WaitAssert.WaitAssertCore[TResult](IWebDriver driver, Func`1 assertion, TimeSpan timeout) in /mnt/vss/_work/1/s/src/Shared/E2ETesting/WaitAssert.cs:line 160
   at Microsoft.AspNetCore.E2ETesting.WaitAssert.WaitAssertCore(IWebDriver driver, Action assertion, TimeSpan timeout) in /mnt/vss/_work/1/s/src/Shared/E2ETesting/WaitAssert.cs:line 93
   at Microsoft.AspNetCore.E2ETesting.WaitAssert.Equal[T](IWebDriver driver, T expected, Func`1 actual) in /mnt/vss/_work/1/s/src/Shared/E2ETesting/WaitAssert.cs:line 29
   at Microsoft.AspNetCore.Components.E2ETests.ServerRenderingTests.RedirectionTest.NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException() in /mnt/vss/_work/1/s/src/Components/test/E2ETest/ServerRenderingTests/RedirectionTest.cs:line 306
   at System.Reflection.IntrinsicInvokeHelper.Instance_Void_0(IntPtr fn, Object obj, IntPtr* _, RuntimeType __)
   at System.Reflection.MethodBaseInvoker.InvokeWithSharedThunk(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
----- Inner Stack Trace -----
   at Microsoft.AspNetCore.E2ETesting.WaitAssert.<>c__DisplayClass23_0`1.<WaitAssertCore>b__0(IWebDriver _) in /mnt/vss/_work/1/s/src/Shared/E2ETesting/WaitAssert.cs:line 129