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

[Bug]: Form inputs do not have a name #5592

Closed
mrpmorris opened this issue Jun 25, 2024 · 3 comments · Fixed by #5593
Closed

[Bug]: Form inputs do not have a name #5592

mrpmorris opened this issue Jun 25, 2024 · 3 comments · Fixed by #5593
Assignees
Labels
Type: Bug 🐞 Something isn't working
Projects
Milestone

Comments

@mrpmorris
Copy link

Blazorise Version

1.5.2

What Blazorise provider are you running on?

Bootstrap5

Link to minimal reproduction or a simple code snippet

N/A

Steps to reproduce

Create a page with form binding to a model. Use the Blazor and also

What is expected?

The generated html should have a name, just as InputText does.

What is actually happening?

Blazor InputText adds a name attribute to InputText etc, this allows Blazor SSR

binding.

Blazorise TextEdit does not do this, so the built in form binding does not work

<InputText @[email protected]/>
<input aria-invalid="true" name="Model.Account" class="invalid" value="asd">

<TextEdit @[email protected]>

What browsers do you see the problem on?

Microsoft Edge

Any additional comments?

N/A

@mrpmorris mrpmorris added the Type: Bug 🐞 Something isn't working label Jun 25, 2024
@David-Moreira
Copy link
Contributor

I have mixed thoughts about this.
Blazorise components have been developed to work with interactivity, so the standard Blazor Server and Blazor Webassembly.

Now Blazor SSR, specifically the mode without interactivity, let's call it static mode. might indeed be supported by Blazor standard components since they can render just enough html structure to be compatible.

However having Blazorise be static mode compatible might not be so easy as to just add a name attribute for instance, since some of the components are made a little more complex, with conditional rendering, with interactivity, with js calls, etc... which does require the "blazor engine" to be running.

So our stance so far as been that we do not support Blazor SSR static mode.
So if we were to do something about this, we would have to look into every component, at least the input based ones, and be sure they are compatible just enough with Blazor static mode.

But since you're opening this issue specifically, how has your experience been with SSR (static mode) + Blazorise? Seems unlikely this would be the only issue stemming from this usage.

@stsrki
Copy link
Collaborator

stsrki commented Jun 26, 2024

I had a chat with @mrpmorris over Discord. This change is only needed for the input components. When inputs are binded to a model( @bind-* ), we need to provide a name attribute. This name attribute is required for the <form> post to work correctly.

Our idea is to reuse what we already have, a FieldIdentifier populated by the ValueExpression parameter. In theory, this should work. If the user wants, they can still override the name by defining it manually, as we already support attribute splatting.

@David-Moreira
Copy link
Contributor

Fine, if that's the only change required and they start working sufficiently in static mode. I would have thought it would be more stuff + possible rendering issues.

@stsrki stsrki self-assigned this Jun 26, 2024
@stsrki stsrki added this to the 1.6 milestone Jun 26, 2024
@stsrki stsrki added this to 🔙 Triage in Development via automation Jun 26, 2024
This was referenced Jun 26, 2024
Development automation moved this from 🔙 Triage to ✔ Done Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Development
  
✔ Done
Development

Successfully merging a pull request may close this issue.

3 participants