Skip to content

Commit

Permalink
fix(module: form): tests failure (#3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderJames committed Mar 21, 2024
1 parent 9db45d1 commit e1ec721
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion components/input/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,10 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
}
}

builder.AddAttribute(46, "name", NameAttributeValue);
if (!string.IsNullOrWhiteSpace(NameAttributeValue))
{
builder.AddAttribute(46, "name", NameAttributeValue);
}

builder.AddAttribute(50, "id", Id);
builder.AddAttribute(51, "type", Type);
Expand Down
11 changes: 8 additions & 3 deletions components/input/TextArea.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//{ "class", ClassMapper.Class },
{ "disabled", Disabled },
{ "readonly", ReadOnly },
};
};

if (AutoSize == false)
{
Expand All @@ -38,13 +38,18 @@
{
Attributes.Keys.ForEach(key => { attributes[key] = Attributes[key]; });
}

if (!string.IsNullOrEmpty(NameAttributeValue))
{
attributes.Add("name", NameAttributeValue);
}
}

@if (Suffix != null || AllowClear || FormItem?.FeedbackIcon != null || ShowCount)
{
<div class="@ClassMapper.Class" style="@Style" data-count="@Count">
<span class="@_warpperClassMapper.Class">
<textarea @ref="Ref" name="@NameAttributeValue" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
<textarea @ref="Ref" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
@if (AllowClear)
{
@ClearIcon
Expand All @@ -64,5 +69,5 @@
}
else
{
<textarea @ref="Ref" name="@NameAttributeValue" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
<textarea @ref="Ref" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
}
5 changes: 2 additions & 3 deletions components/radio/Radio.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@typeparam TValue
@inherits AntDomComponentBase

<label @onclick="OnClick" class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref" for="@(Id)_input" >
<label @onclick="OnClick" class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref">
<span class="@_radioClassMapper.Class">
<input type="radio"
autofocus="@AutoFocus"
Expand All @@ -11,8 +11,7 @@
checked="@Checked"
name="@_name"
value="@Value"
@ref="_inputRef"
id="@(Id)_input" />
@ref="_inputRef"/>
<span class="@_innerClassMapper.Class"></span>
</span>
@if (ChildContent != null)
Expand Down

0 comments on commit e1ec721

Please sign in to comment.