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

View File

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

View File

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