Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NET9.0.0 Blazor @onclick:preventDefault is not working in Balzor NET. It was working in Blazor NET7. #59687

Open
Acruval opened this issue Jan 1, 2025 · 0 comments
Labels
area-blazor Includes: Blazor, Razor Components untriaged

Comments

@Acruval
Copy link

Acruval commented Jan 1, 2025

NET9.0.0 Blazor @OnClick:preventDefault is not working in Balzor NET. It was working in Blazor NET7.
<a class="page-link" href="#" aria-label="Previous" @onclick="()=>DecPage()" @onclick:preventDefault>

Workarround: use javascrit:void(0);
<a class="page-link" href="javascript:void(0);" aria-label="Previous" @onclick="()=>DecPage()" @onclick:preventDefault>

PS. I use on the page @rendermode InteractiveServer

@davidwengier davidwengier transferred this issue from dotnet/razor Jan 1, 2025
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components untriaged
Projects
None yet
Development

No branches or pull requests

1 participant