fix(module: datepicker): the reference value of initValue (#3459)

* fix initValue reference

* fix name
This commit is contained in:
James Yeung 2023-10-20 00:21:04 +08:00 committed by GitHub
parent faa26e202d
commit f469aea9a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -370,7 +370,7 @@ namespace AntDesign
}
ResetPlaceholder();
_initValue = Value;
_initValue = (TValue)(_value as Array).Clone();
}
/// <summary>

View File

@ -8,7 +8,7 @@
string style = "";
if (currentViewDate.Day == 1)
{
style = "border: 1px solid #1890ff; borderRadius: 50%";
style = "border: 1px solid #1890ff; border-radius: 50%";
}
return @<div class="ant-picker-cell-inner" style="@style">

View File

@ -24,7 +24,9 @@
</SelectOptions>
</Select>
</FormItem>
<FormItem Label="DateRange">
<RangePicker @bind-Value="context.DateRange" />
</FormItem>
<FormItem WrapperColOffset="8" WrapperColSpan="16">
<Button Type="@ButtonType.Primary" HtmlType="submit">
Submit
@ -45,6 +47,8 @@
public string Note { get; set; }
[Required]
public string Gender { get; set; }
[Required]
public DateTime?[] DateRange { get; set; }
}
private Model model = new Model();
@ -54,6 +58,7 @@
{
model.Note = "Hello Sir!";
model.Gender = "Male";
model.DateRange = new DateTime?[] { DateTime.Now, DateTime.Now.AddDays(1) };
Console.WriteLine($"form ref:{form}");
}