From 1a3648bbd687ef4386e0eecf409241361a40f467 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 3 Jul 2023 15:57:40 +0800 Subject: [PATCH 1/4] Fix Tag Helper Floating labels --- .../TagHelpers/Form/AbpInputTagHelperService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c3a8f80690..d3469c77bf 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 @@ -101,7 +101,7 @@ protected virtual async Task GetValidationAsHtmlAsync(TagHelperContext c protected virtual string GetContent(TagHelperContext context, TagHelperOutput output, string label, string inputHtml, string validation, string infoHtml, bool isCheckbox) { - var innerContent = isCheckbox ? + var innerContent = isCheckbox || TagHelper.FloatingLabel ? inputHtml + label : label + inputHtml; From ba8fe7b6596a7cf3172ba884d54dedd0b3c66848 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 3 Jul 2023 16:04:09 +0800 Subject: [PATCH 2/4] Update document --- docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md | 1 + docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md b/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md index 54e9712d30..d8a69d7c94 100644 --- a/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md +++ b/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md @@ -87,6 +87,7 @@ You can set some of the attributes on your c# property, or directly on HTML tag. * `readonly`: Sets the input as read-only. * `label`: Sets the label of input. * `required-symbol`: Adds the required symbol `(*)` to the label when the input is required. The default value is `True`. +* `FloatingLabel`: Sets the label as floating label. The default value is `False`. `asp-format`, `name` and `value` attributes of [Asp.Net Core Input Tag Helper](https://docs.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms?view=aspnetcore-7.0#the-input-tag-helper) are also valid for `abp-input` tag helper. diff --git a/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md index 5f03301357..14b0905d69 100644 --- a/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md +++ b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md @@ -196,6 +196,8 @@ Model: - `AbpFormControlSize.Large` - `label`: 为输入设置标签。 - `display-required-symbol`: 如果输入是必需的,则向标签添加必需符号 (*)。默认为 `True`。 +- `FloatingLabel`: 设置输入的标签是否应该是浮动的。默认为 `False`。 + ### 标签和本地化 From 14861391899c5c08c1b50df3ab1d96ae7902e233 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 3 Jul 2023 16:39:43 +0800 Subject: [PATCH 3/4] Update docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md Co-authored-by: Qingxiao Ren --- docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md b/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md index d8a69d7c94..b8a55c2ad3 100644 --- a/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md +++ b/docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md @@ -87,7 +87,7 @@ You can set some of the attributes on your c# property, or directly on HTML tag. * `readonly`: Sets the input as read-only. * `label`: Sets the label of input. * `required-symbol`: Adds the required symbol `(*)` to the label when the input is required. The default value is `True`. -* `FloatingLabel`: Sets the label as floating label. The default value is `False`. +* `floating-label`: Sets the label as floating label. The default value is `False`. `asp-format`, `name` and `value` attributes of [Asp.Net Core Input Tag Helper](https://docs.microsoft.com/en-us/aspnet/core/mvc/views/working-with-forms?view=aspnetcore-7.0#the-input-tag-helper) are also valid for `abp-input` tag helper. From 9ab93a2f0399d7230f74582db0662af14a2aa185 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 3 Jul 2023 16:39:51 +0800 Subject: [PATCH 4/4] Update docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md Co-authored-by: Qingxiao Ren --- docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md index 14b0905d69..a5629fb16a 100644 --- a/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md +++ b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md @@ -196,7 +196,7 @@ Model: - `AbpFormControlSize.Large` - `label`: 为输入设置标签。 - `display-required-symbol`: 如果输入是必需的,则向标签添加必需符号 (*)。默认为 `True`。 -- `FloatingLabel`: 设置输入的标签是否应该是浮动的。默认为 `False`。 +- `floating-label`: 设置输入的标签是否应该是浮动的。默认为 `False`。 ### 标签和本地化