-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Validate passing unmatched attributes to Blazor form components #10790
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
Comments
note: this validation should be considered blocked until we have a d16.2 build with all of the editor fixes in it. Since it touches the editing experiences, we should do the validation of this feature once those things land. |
I'm mostly done here, I found one issue and want to make one clarification:
<InputText Id="name" @bind-Value="@exampleModel.Name" firstOrLast="first" /> with will be output in html as: <input id="name" firstorlast="first />
1 doesn't seem like a blocker in either case, but definitly something @SteveSandersonMS should have a look at,. If I get confirmation of my interpretation of 2 this will be good to go. |
2 didn't mean what I thought it did (actually meant that if we have an unbound parameter, a bound parameter, then further unbound parameters they should all end up in the right place) but it's been verified. Leaving this option to get @SteveSandersonMS's opinion on "Preserves original case of unmatched attributes", but that's relatively minor, so we can count this as done for release purposes. |
@SteveSandersonMS is there something that we're doing in the JS code to force attributes to lower case? I found this behaviour surprising and the compiled code has the original case. |
I think this is just something in the way that browsers handle attributes: If I just create a plain |
Summary
Preview 6 adds the ability to pass arbitrary attributes to our form components and have them flow through to the underlying HTML element associated with the component.
Example: (the ability to specify placeholder is the usage of the new feature)
For now
Class
andId
are still defined as component parameters. This will be removed in preview 7 and these attributes will also use the unmatched attributes support.For now the completion experience on the
InputText
element won't offer you attributes likeplaceholder
in VS.Checklist
EditForm
InputCheckbox
InputDate
InputNumber
InputSelect
InputText
InputTextArea
ValidationMessage
ValidationSummary
References
The text was updated successfully, but these errors were encountered: