diff --git a/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netstandard2.0.cs b/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netstandard2.0.cs index f577a4708810..40eb71e9a2aa 100644 --- a/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netstandard2.0.cs +++ b/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.netstandard2.0.cs @@ -6,7 +6,9 @@ namespace Microsoft.AspNetCore.Components [Microsoft.AspNetCore.Components.BindElementAttribute("select", null, "value", "onchange")] [Microsoft.AspNetCore.Components.BindElementAttribute("textarea", null, "value", "onchange")] [Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange", false, null)] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("date", "value", "value", "onchange", true, "yyyy-MM-dd")] [Microsoft.AspNetCore.Components.BindInputElementAttribute("date", null, "value", "onchange", true, "yyyy-MM-dd")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("number", "value", "value", "onchange", true, null)] [Microsoft.AspNetCore.Components.BindInputElementAttribute("number", null, "value", "onchange", true, null)] [Microsoft.AspNetCore.Components.BindInputElementAttribute("text", null, "value", "onchange", false, null)] [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, "value", "value", "onchange", false, null)] diff --git a/src/Components/Web/src/BindAttributes.cs b/src/Components/Web/src/BindAttributes.cs index 69b4720b0a7f..91a1ee894c90 100644 --- a/src/Components/Web/src/BindAttributes.cs +++ b/src/Components/Web/src/BindAttributes.cs @@ -24,9 +24,11 @@ namespace Microsoft.AspNetCore.Components // type="number" is invariant culture [BindInputElement("number", null, "value", "onchange", isInvariantCulture: true, format: null)] + [BindInputElement("number", "value", "value", "onchange", isInvariantCulture: true, format: null)] // type="date" is invariant culture with a specific format [BindInputElement("date", null, "value", "onchange", isInvariantCulture: true, format: "yyyy-MM-dd")] + [BindInputElement("date", "value", "value", "onchange", isInvariantCulture: true, format: "yyyy-MM-dd")] [BindElement("select", null, "value", "onchange")] [BindElement("textarea", null, "value", "onchange")] diff --git a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor index 6f132f6f6afe..5cdd9087eae8 100644 --- a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor @@ -1,5 +1,7 @@

Bind cases

+@* There are a mix of cases here using bind and bind-value for coverage *@ +

Textbox

Initially blank: @@ -32,7 +34,7 @@

Nullable int: - + @textboxNullableIntValue

@@ -50,7 +52,7 @@

float: - + @textboxFloatValue

@@ -74,7 +76,7 @@

decimal: - + @textboxDecimalValue

@@ -119,7 +121,7 @@

Nullable DateTime: - + @textboxNullableDateTimeValue

@@ -149,7 +151,7 @@

DateTime (format): - + @textboxDateTimeFormatValue

@@ -161,7 +163,7 @@

DateTime (format / invalid value): - + @textboxDateTimeFormatInvalidValue

diff --git a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor index bc7a53c4a3b5..9f4dadf7a94e 100644 --- a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor +++ b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor @@ -3,6 +3,8 @@

Globalization Bind Cases

Culture is: @System.Globalization.CultureInfo.CurrentCulture.Name

+@* There are a mix of cases here using bind and bind-value for coverage *@ +

Numbers using bind in text fields

@@ -10,7 +12,7 @@ @inputTypeTextInt
- decimal: + decimal: @inputTypeTextDecimal
@@ -22,7 +24,7 @@ @inputTypeTextDateTime
- DateTimeOffset: + DateTimeOffset: @inputTypeTextDateTimeOffset
@@ -34,7 +36,7 @@ @inputTypeNumberInt
- decimal: + decimal: @inputTypeNumberDecimal
@@ -47,7 +49,7 @@ @inputTypeDateDateTime
- DateTimeOffset: + DateTimeOffset: @inputTypeDateDateTimeOffset