bind-Value on EditText often results in the wrong thing (dotnet/aspnetcore-tooling#364)
Updates the bindtaghelperdescriptorprovider to use the changed event property type name on the bound attribute instead of the value property type attribute.\n\nCommit migrated from 3009045206
This commit is contained in:
parent
f98ffcd759
commit
9c35c07a0b
|
|
@ -437,7 +437,7 @@ namespace Microsoft.CodeAnalysis.Razor
|
||||||
changeAttribute.Name);
|
changeAttribute.Name);
|
||||||
|
|
||||||
attribute.Name = "bind-" + valueAttribute.Name;
|
attribute.Name = "bind-" + valueAttribute.Name;
|
||||||
attribute.TypeName = valueAttribute.TypeName;
|
attribute.TypeName = changeAttribute.TypeName;
|
||||||
attribute.IsEnum = valueAttribute.IsEnum;
|
attribute.IsEnum = valueAttribute.IsEnum;
|
||||||
|
|
||||||
// WTE has a bug 15.7p1 where a Tag Helper without a display-name that looks like
|
// WTE has a bug 15.7p1 where a Tag Helper without a display-name that looks like
|
||||||
|
|
|
||||||
|
|
@ -122,11 +122,11 @@ namespace Test
|
||||||
|
|
||||||
Assert.Equal("bind-MyProperty", attribute.Name);
|
Assert.Equal("bind-MyProperty", attribute.Name);
|
||||||
Assert.Equal("MyProperty", attribute.GetPropertyName());
|
Assert.Equal("MyProperty", attribute.GetPropertyName());
|
||||||
Assert.Equal("string Test.MyComponent.MyProperty", attribute.DisplayName);
|
Assert.Equal("System.Action<System.String> Test.MyComponent.MyProperty", attribute.DisplayName);
|
||||||
|
|
||||||
// Defined from the property type
|
// Defined from the property type
|
||||||
Assert.Equal("System.String", attribute.TypeName);
|
Assert.Equal("System.Action<System.String>", attribute.TypeName);
|
||||||
Assert.True(attribute.IsStringProperty);
|
Assert.False(attribute.IsStringProperty);
|
||||||
Assert.False(attribute.IsBooleanProperty);
|
Assert.False(attribute.IsBooleanProperty);
|
||||||
Assert.False(attribute.IsEnum);
|
Assert.False(attribute.IsEnum);
|
||||||
}
|
}
|
||||||
|
|
@ -237,11 +237,11 @@ namespace Test
|
||||||
|
|
||||||
Assert.Equal("bind-MyProperty", attribute.Name);
|
Assert.Equal("bind-MyProperty", attribute.Name);
|
||||||
Assert.Equal("MyProperty", attribute.GetPropertyName());
|
Assert.Equal("MyProperty", attribute.GetPropertyName());
|
||||||
Assert.Equal("string Test.MyComponent.MyProperty", attribute.DisplayName);
|
Assert.Equal("Microsoft.AspNetCore.Components.EventCallback<System.String> Test.MyComponent.MyProperty", attribute.DisplayName);
|
||||||
|
|
||||||
// Defined from the property type
|
// Defined from the property type
|
||||||
Assert.Equal("System.String", attribute.TypeName);
|
Assert.Equal("Microsoft.AspNetCore.Components.EventCallback<System.String>", attribute.TypeName);
|
||||||
Assert.True(attribute.IsStringProperty);
|
Assert.False(attribute.IsStringProperty);
|
||||||
Assert.False(attribute.IsBooleanProperty);
|
Assert.False(attribute.IsBooleanProperty);
|
||||||
Assert.False(attribute.IsEnum);
|
Assert.False(attribute.IsEnum);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue