Browse Source

Merge pull request #17009 from abpframework/lianshiwei/Floatinglabels

Fix Tag Helper Floating labels
pull/17010/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
9e61fd64d2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      docs/en/UI/AspNetCore/Tag-Helpers/Form-elements.md
  2. 2
      docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md
  3. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs

1
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`.
* `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.

2
docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md

@ -196,6 +196,8 @@ Model:
- `AbpFormControlSize.Large`
- `label`: 为输入设置标签。
- `display-required-symbol`: 如果输入是必需的,则向标签添加必需符号 (*)。默认为 `True`
- `floating-label`: 设置输入的标签是否应该是浮动的。默认为 `False`
### 标签和本地化

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs

@ -101,7 +101,7 @@ public class AbpInputTagHelperService : AbpTagHelperService<AbpInputTagHelper>
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;

Loading…
Cancel
Save