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

Calculate input name attribute in SSR mode #5593

Merged
merged 7 commits into from
Jun 28, 2024
Merged

Conversation

stsrki
Copy link
Collaborator

@stsrki stsrki commented Jun 26, 2024

Closes #5592

At first, I tried using FieldIdentifier, but we had several problems.

  1. FieldIdentifier is only available on Validations. I tried to bring it down to input level, but it was too complex and it broke the validation. We can reconsider this for 2.0 as I have realized we had to break some APIs also.
  2. The FieldIdentifier was generating invalid names, eg. FieldName instead of Model.FieldName.

So, I went and saw how they do it in .NET core. I have copied their helpers, who are internal only and brought them to Blazorise. Then, I used some of the code to generate the name attribute. simplified it, and made it to work with our components. It works as expected.

One problem, though. On our Radio component, we already have the Name parameter. I still need to see what to do with it.

I still want to see if there is only room for improvement. This is only a first run.


@mrpmorris Any chance you could test it?

Copy link
Contributor

@David-Moreira David-Moreira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I didn't bother going through the microsoft classes.

@stsrki stsrki merged commit 1e9465d into master Jun 28, 2024
2 checks passed
@stsrki stsrki deleted the dev-form-inputs-name branch June 28, 2024 07:20
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Form inputs do not have a name
2 participants