Skip to content

Commit ccd3bdb

Browse files
authored
fix(Widget): throw exception when dispose (#4665)
* fix(Widget): 修复报错问题 * chore: bump version 9.0.0-beta03
1 parent 525eaac commit ccd3bdb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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.0.0-beta02</Version>
4+
<Version>9.0.0-beta03</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/DropdownWidget/DropdownWidget.razor.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ export function init(id, invoke, options) {
1919
}
2020

2121
export function dispose(id) {
22-
EventHandler.off(el, 'hidden.bs.dropdown');
22+
const el = document.getElementById(id);
23+
if (el) {
24+
EventHandler.off(el, 'shown.bs.dropdown');
25+
EventHandler.off(el, 'hidden.bs.dropdown');
26+
}
2327
}

0 commit comments

Comments
 (0)