diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs index c763fc037d..0c5ac5dd22 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form public bool IsDisabled { get; set; } = false; [HtmlAttributeName("readonly")] - public AbpReadonlyInputType IsReadonly { get; set; } = AbpReadonlyInputType.False; + public bool? IsReadonly { get; set; } = false; public bool AutoFocus { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index f70ed6bb32..efed164ad6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -143,16 +143,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form private void AddFormControlClass(TagHelperContext context, TagHelperOutput output, bool isCheckbox, TagHelperOutput inputTagHelperOutput) { var className = "form-control"; - var readonlyAttribute = GetAttribute(TagHelper.AspFor.ModelExplorer); if (isCheckbox) { className = "form-check-input"; } - else if (TagHelper.IsReadonly == AbpReadonlyInputType.True_PlainText || (readonlyAttribute != null && readonlyAttribute.PlainText)) - { - className = "form-control-plaintext"; - } inputTagHelperOutput.Attributes.AddClass(className + " " + GetSize(context, output)); } @@ -177,7 +172,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form protected virtual void AddReadOnlyAttribute(TagHelperOutput inputTagHelperOutput) { if (inputTagHelperOutput.Attributes.ContainsName("readonly") == false && - (TagHelper.IsReadonly != AbpReadonlyInputType.False || GetAttribute(TagHelper.AspFor.ModelExplorer) != null)) + (TagHelper.IsReadonly != false || GetAttribute(TagHelper.AspFor.ModelExplorer) != null)) { inputTagHelperOutput.Attributes.Add("readonly", ""); } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml index 8934a81aa9..f9df603f2c 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml @@ -301,7 +301,6 @@ public class DynamicFormsModel : PageModel MyAttributeExamplesModel = new AttributeExamplesModel(); MyAttributeExamplesModel.DisabledInput = "Disabled Input"; MyAttributeExamplesModel.ReadonlyInput = "Readonly Input"; - MyAttributeExamplesModel.ReadonlyPlainTextInput = "Readonly Plain Text Input"; MyAttributeExamplesModel.LargeInput = "Large Input"; MyAttributeExamplesModel.SmallInput = "Small Input"; } @@ -317,9 +316,6 @@ public class DynamicFormsModel : PageModel [ReadOnlyInput] public string ReadonlyInput { get; set; } - [ReadOnlyInput(PlainText = true)] - public string ReadonlyPlainTextInput { get; set; } - [FormControlSize(AbpFormControlSize.Large)] public string LargeInput { get; set; } @@ -350,11 +346,6 @@ public class DynamicFormsModel : PageModel <input type="text" id="MyAttributeExamplesModel_ReadonlyInput" name="MyAttributeExamplesModel.ReadonlyInput" value="Readonly Input" class="form-control " readonly=""> <span class="text-danger field-validation-valid" data-valmsg-for="MyAttributeExamplesModel.ReadonlyInput" data-valmsg-replace="true"></span> </div> - <div class="form-group"> - <label for="MyAttributeExamplesModel_ReadonlyPlainTextInput">ReadonlyPlainTextInput</label> - <input type="text" id="MyAttributeExamplesModel_ReadonlyPlainTextInput" name="MyAttributeExamplesModel.ReadonlyPlainTextInput" value="Readonly Plain Text Input" class="form-control-plaintext " readonly=""> - <span class="text-danger field-validation-valid" data-valmsg-for="MyAttributeExamplesModel.ReadonlyPlainTextInput" data-valmsg-replace="true"></span> - </div> <div class="form-group"> <label for="MyAttributeExamplesModel_LargeInput">LargeInput</label> <input type="text" id="MyAttributeExamplesModel_LargeInput" name="MyAttributeExamplesModel.LargeInput" value="Large Input" class="form-control form-control-lg"> diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs index 7854da4920..c61423c6a6 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs @@ -51,7 +51,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components { DisabledInput = "Disabled Input", ReadonlyInput = "Readonly Input", - ReadonlyPlainTextInput = "Readonly Plain Text Input", LargeInput = "Large Input", SmallInput = "Small Input" }; @@ -74,9 +73,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components [ReadOnlyInput] public string ReadonlyInput { get; set; } - [ReadOnlyInput(PlainText = true)] - public string ReadonlyPlainTextInput { get; set; } - [FormControlSize(AbpFormControlSize.Large)] public string LargeInput { get; set; } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml index b62c610fbc..3dfea6bcb6 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml @@ -239,8 +239,7 @@
- - +
@@ -256,7 +255,6 @@ MyModel.SampleInput0 = "This is a disabled input."; MyModel.SampleInput0 = "This is a disabled input."; MyModel.SampleInput1 = "This is a readonly input."; - MyModel.SampleInput2 = "This is a readonly plain-text."; } public class SampleModel @@ -274,7 +272,6 @@

 <abp-input asp-for="@@Model.MyModel.SampleInput0" disabled="true" />
 <abp-input asp-for="@@Model.MyModel.SampleInput1" readonly="True" />
-<abp-input asp-for="@@Model.MyModel.SampleInput2" readonly="True_PlainText"/>
 
@@ -289,11 +286,6 @@ <input type="text" id="MyModel_SampleInput1" name="MyModel.SampleInput1" value="This is a readonly input." class="form-control " readonly=""> <span class="text-danger field-validation-valid" data-valmsg-for="MyModel.SampleInput1" data-valmsg-replace="true"></span> </div> -<div class="form-group"> - <label for="MyModel_SampleInput2">SampleInput2</label> - <input type="text" id="MyModel_SampleInput2" name="MyModel.SampleInput2" value="This is a readonly plain-text." class="form-control-plaintext " readonly=""> - <span class="text-danger field-validation-valid" data-valmsg-for="MyModel.SampleInput2" data-valmsg-replace="true"></span> -</div>
diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs index 6a3f432220..dca438d5a8 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs @@ -27,7 +27,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components MyModel = new SampleModel(); MyModel.SampleInput0 = "This is a disabled input."; MyModel.SampleInput1 = "This is a readonly input."; - MyModel.SampleInput2 = "This is a readonly plain-text."; MyModel.CityRadio = "IST"; }