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

Add intellisense support for new data-enhance, data-enhance-nav, and data-permanent Blazor attributes in .NET 8 #9378

Open
danroth27 opened this issue Oct 7, 2023 · 0 comments
Labels
area-compiler Umbrella for all compiler issues feature request Large improvement request
Milestone

Comments

@danroth27
Copy link
Member

In .NET 8 RC2 we introduced some new attributes that Blazor users can use to control enhanced navigation and form handling:

  • data-enhance-nav: Used to turn off enhanced navigation for a specific link or DOM subtree

    <a href="my-non-blazor-page" data-enhance-nav="false">My Non-Blazor Page</a>
  • data-enhance: Used to opt in to enhanced form handling for a form element:

    <form method="post" @onsubmit="() => submitted = true" @formname="name" data-enhance>
        <AntiforgeryToken />
        <InputText @bind-Value="Name" />
        <button>Submit</button>
    </form>
    
    @if (submitted)
    {
        <p>Hello @Name!</p>
    }
    
    @code{
        bool submitted;
    
        [SupplyParameterFromForm]
        public string Name { get; set; } = "";
    }
  • data-permanent: Used to signal that an element add or updated dynamically should be preserved when handling an enhanced navigation of form request:

    <div data-permanent>
        This div gets updated dynamically by a script when the page loads!
    </div>

We should update the Razor tooling to provide appropriate completions and diagnostic for these attributes.

Related PRs:

@ghost ghost added the untriaged label Oct 7, 2023
@davidwengier davidwengier added the area-compiler Umbrella for all compiler issues label Oct 8, 2023
@chsienki chsienki added the feature request Large improvement request label Oct 31, 2023
@chsienki chsienki added this to the Backlog milestone Oct 31, 2023
@ghost ghost removed the untriaged label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-compiler Umbrella for all compiler issues feature request Large improvement request
Projects
None yet
Development

No branches or pull requests

3 participants