Skip to content

Commit 1e1454a

Browse files
authored
fix(DateTimeRange): should close popup after click confirm button (#5668)
* refactor: 增加关窗逻辑 * refactor: 精简代码 * chore: bump version 9.5.0-beta08 * refactor: 修复清空按钮不关窗问题
1 parent 4f9e787 commit 1e1454a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.5.0-beta07</Version>
4+
<Version>9.5.0-beta08</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
<BootstrapLabel required="@Required" for="@Id" ShowLabelTooltip="ShowLabelTooltip" Value="@DisplayText" />
99
}
10-
<div @attributes="@AdditionalAttributes" tabindex="@TabIndexString" id="@Id" class="@ClassString" data-bb-dropdown=".picker-panel" data-bb-dismiss=".picker-panel-link-btn">
10+
<div @attributes="@AdditionalAttributes" tabindex="@TabIndexString" id="@Id" class="@ClassString" data-bb-dropdown=".picker-panel">
1111
<input readonly="@ReadonlyString" class="@InputClassName" @bind="@CurrentValueAsString" placeholder="@PlaceholderString" disabled="@Disabled" data-bs-toggle="@Constants.DropdownToggleString" data-bs-placement="@PlacementString" data-bs-custom-class="@CustomClassString" @onblur="OnBlur" />
1212
@if (ShowIcon)
1313
{

src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
<BootstrapLabel required="@Required" ShowLabelTooltip="ShowLabelTooltip" Value="@DisplayText" />
88
}
9-
<div @attributes="@AdditionalAttributes" id="@Id" tabindex="0" class="@ClassString" data-bb-dropdown=".datetime-range-body" data-bb-dismiss=".picker-panel-link-btn">
9+
<div @attributes="@AdditionalAttributes" id="@Id" tabindex="0" class="@ClassString" data-bb-dropdown=".datetime-range-body">
1010
<div class="dropdown-toggle datetime-range-control" data-bs-toggle="@Constants.DropdownToggleString" data-bs-placement="@PlacementString" data-bs-custom-class="@CustomClassString">
1111
<div class="position-relative">
1212
<i class="@DateTimePickerIconClassString"></i>
@@ -37,13 +37,15 @@
3737
{
3838
<DatePickerBody Value="@StartValue" ValueChanged="UpdateValue" OnDateChanged="OnStartDateChanged"
3939
DateFormat="@DateFormat" TimeFormat="@TimeFormat" ViewMode="ViewMode"
40-
ShowLunar="ShowLunar" ShowSolarTerm="ShowSolarTerm" ShowFestivals="ShowFestivals" ShowHolidays="ShowHolidays"
40+
ShowLunar="ShowLunar" ShowSolarTerm="ShowSolarTerm"
41+
ShowFestivals="ShowFestivals" ShowHolidays="ShowHolidays"
4142
ShowRightButtons="false" MaxValue="MaxValue" MinValue="MinValue">
4243
</DatePickerBody>
4344
}
4445
<DatePickerBody Value="@EndValue" ValueChanged="UpdateValue" OnDateChanged="OnEndDateChanged"
4546
DateFormat="@DateFormat" TimeFormat="@TimeFormat" ViewMode="ViewMode"
46-
ShowLunar="ShowLunar" ShowSolarTerm="ShowSolarTerm" ShowFestivals="ShowFestivals" ShowHolidays="ShowHolidays"
47+
ShowLunar="ShowLunar" ShowSolarTerm="ShowSolarTerm"
48+
ShowFestivals="ShowFestivals" ShowHolidays="ShowHolidays"
4749
ShowLeftButtons="@_showLeftButtons" MaxValue="MaxValue" MinValue="MinValue">
4850
</DatePickerBody>
4951
</CascadingValue>

src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ private async Task ClickClearButton()
375375
{
376376
EditContext.NotifyFieldChanged(FieldIdentifier.Value);
377377
}
378+
await InvokeVoidAsync("hide", Id);
378379
}
379380

380381
private Task OnStartDateChanged(DateTime value)
@@ -442,6 +443,7 @@ private async Task ClickConfirmButton()
442443
{
443444
EditContext.NotifyFieldChanged(FieldIdentifier.Value);
444445
}
446+
await InvokeVoidAsync("hide", Id);
445447
}
446448

447449
/// <summary>

0 commit comments

Comments
 (0)