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

[Blazor] Disable enhanced navigation on a per-element basis #50290

Closed
javiercn opened this issue Aug 23, 2023 · 2 comments
Closed

[Blazor] Disable enhanced navigation on a per-element basis #50290

javiercn opened this issue Aug 23, 2023 · 2 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components blog-candidate Consider mentioning this in the release blog post enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-enhanced-navigation
Milestone

Comments

@javiercn
Copy link
Member

  • Check for a data-enhanced-navigation attribute on the element.
  • Skip using enhanced navigation if that's the case and fallback to a traditional reload.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Aug 23, 2023
@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-enhanced-navigation labels Aug 28, 2023
@mkArtakMSFT
Copy link
Member

We should also consider enabling a scenario for disabling enhanced navigation for a component hierarchy, rather than a single component only.

@SteveSandersonMS
Copy link
Member

Done in #50551

The new rules are:

  • For forms, enhanced nav is off by default. To turn it on, put data-enhance on the form element, or Enhance if it's an EditForm
  • For links, enhanced nav is on by default. Control it by putting data-enhance-nav="true/false" either on the <a> itself or on any ancestor element. When a link is clicked, we find its closest ancestor with a setting and use that, so you can override in either direction.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components blog-candidate Consider mentioning this in the release blog post enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-enhanced-navigation
Projects
None yet
Development

No branches or pull requests

4 participants