fix(module: input): incorrect html structure of TextArea icons (#3367)

* fix(module: input): incorrect html structure of TextArea icons

* fix tests
This commit is contained in:
James Yeung 2023-07-27 08:14:58 +08:00 committed by GitHub
parent a5db6629da
commit a49127c190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 18 deletions

View File

@ -4,7 +4,7 @@
@{
Dictionary<string, object> attributes =
new Dictionary<string, object>()
{
{
//{ "onchange", EventUtil.AsNonRenderingEventHandler<ChangeEventArgs>(e => OnChangeAsync(e)) },
//{ "onblur", EventUtil.AsNonRenderingEventHandler<FocusEventArgs>(e => OnBlurAsync(e)) },
//{ "oninput", EventUtil.AsNonRenderingEventHandler<ChangeEventArgs>(e => OnInputAsync(e)) },
@ -26,7 +26,7 @@
//{ "class", ClassMapper.Class },
{ "disabled", Disabled },
{ "readonly", ReadOnly },
};
};
if (AutoSize == false)
{
@ -39,16 +39,17 @@
}
}
@if (Suffix != null || AllowClear || FormItem?.FeedbackIcon != null)
@if (Suffix != null || AllowClear || FormItem?.FeedbackIcon != null || ShowCount)
{
<span class="@_warpperClassMapper.Class">
<textarea @ref="Ref" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
<span class="ant-input-textarea-suffix">
<div class="@ClassMapper.Class" style="@Style" data-count="@Count">
<span class="@_warpperClassMapper.Class">
<textarea @ref="Ref" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
@if (AllowClear)
{
@ClearIcon
}
</span>
<span class="ant-input-textarea-suffix">
@if (Suffix != null)
{
@Suffix
@ -58,12 +59,6 @@
@FormItem.FeedbackIcon
}
</span>
</span>
}
else if (ShowCount)
{
<div class="@ClassMapper.Class" style="@Style" data-count="@Count">
<textarea @ref="Ref" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
</div>
}
else

View File

@ -110,10 +110,10 @@ namespace AntDesign
/// <summary>
/// Sets the height of the TextArea expressed in number of rows.
/// Default value is 3.
/// Default value is 2.
/// </summary>
[Parameter]
public uint Rows { get; set; } = 3;
public uint Rows { get; set; } = 2;
/// <summary>
/// Callback when the size changes

View File

@ -7,8 +7,12 @@
<Radio RadioButton Value=@FormRequiredMark.None>None</Radio>
</RadioGroup>
<Form Model="@model" ValidateMode=@FormValidateMode.Complex RequiredMark=@ChosenRequiredMark>
<FormItem Label="Required By Parameter" Required>
<Form
Model="@model"
Layout="vertical"
ValidateMode=@FormValidateMode.Complex
RequiredMark=@ChosenRequiredMark>
<FormItem Label="Required By Parameter" Required >
<Input @bind-Value="@context.RequiredByParameter" />
</FormItem>
<FormItem Label="Required By Rule Field" Rules=@(new FormValidationRule[]{ new FormValidationRule{ Required = true } })>
@ -17,7 +21,7 @@
<FormItem Label="Required By Data Attribute">
<Input @bind-Value="@context.RequiredByDataAttribute" />
</FormItem>
<FormItem Label="Optional">
<FormItem Label="Optional" >
<Input @bind-Value="@context.Optional" />
</FormItem>
</Form>