Blazor-DataBinding-FormsXrefFix (#31968)

pull/31970/head
Robert Haken 2024-03-05 12:07:19 +01:00 committed by GitHub
parent 1192764b9c
commit 1b0d16d912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -31,5 +31,8 @@
"MD025": {
"front_matter_title": ""
}
}
},
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}

View File

@ -492,7 +492,7 @@ For the `oninput` event (`@bind:event="oninput"`), a value reversion occurs afte
* Don't use the `oninput` event. Use the default `onchange` event, where an invalid value isn't reverted until the element loses focus.
* Bind to a nullable type, such as `int?` or `string` and either use `@bind:get`/`@bind:set` modifiers (described earlier in this article) or [bind to a property with custom `get` and `set` accessor logic](#binding-to-a-property-with-c-get-and-set-accessors) to handle invalid entries.
* Use a [form validation component](xref:blazor/forms/validation), such as <xref:Microsoft.AspNetCore.Components.Forms.InputNumber%601> or <xref:Microsoft.AspNetCore.Components.Forms.InputDate%601>. Form validation components provide built-in support to manage invalid inputs. Form validation components:
* Use an [input component](xref:blazor/forms/input-components), such as <xref:Microsoft.AspNetCore.Components.Forms.InputNumber%601> or <xref:Microsoft.AspNetCore.Components.Forms.InputDate%601>, with [form validation](xref:blazor/forms/validation). Input components together with form validation components provide built-in support to manage invalid inputs:
* Permit the user to provide invalid input and receive validation errors on the associated <xref:Microsoft.AspNetCore.Components.Forms.EditContext>.
* Display validation errors in the UI without interfering with the user entering additional webform data.