Skip to content

Commit 291eb63

Browse files
authored
fix(AutoComplete): trigger OnValueChanged when the Value changed (#5485)
* refactor: 移除不使用的变量 * refactor: 精简代码逻辑 * fix: 增加 change 销毁事件 * refactor: 增加 Value 更新逻辑 * chore: bump version 9.4.3-beta03
1 parent 38dc157 commit 291eb63

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
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.4.3-beta02</Version>
4+
<Version>9.4.3-beta03</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public override async Task TriggerFilter(string val)
157157
{
158158
_filterItems = [.. _filterItems.Take(DisplayCount.Value)];
159159
}
160-
StateHasChanged();
160+
await TriggerChange(val);
161161
}
162162

163163
/// <summary>

src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ export function init(id, invoke) {
6868
}, filterDuration);
6969

7070
Input.composition(input, v => {
71-
const useInput = input.getAttribute('data-bb-input') !== 'false';
72-
if (isPopover === false && useInput) {
71+
if (isPopover === false) {
7372
el.classList.add('show');
7473
}
7574

@@ -164,13 +163,14 @@ export function dispose(id) {
164163
Data.remove(id)
165164

166165
if (ac) {
167-
const { popover, input, menu } = ac;
166+
const { popover, input } = ac;
168167
if (popover) {
169168
Popover.dispose(popover)
170169
if (input) {
171170
EventHandler.off(input, 'focus')
172171
}
173172
}
173+
EventHandler.off(input, 'change');
174174
EventHandler.off(input, 'keyup');
175175
EventHandler.off(input, 'blur');
176176
Input.dispose(input);

0 commit comments

Comments
 (0)