Skip to content

Commit bce62d4

Browse files
committed
refactor: 增加禁用逻辑
1 parent eff57fd commit bce62d4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/BootstrapBlazor.Region/Components/Region.razor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public partial class Region
5555
private IRegionService? RegionService { get; set; }
5656

5757
private string? ClassString => CssBuilder.Default("select bb-region")
58+
.AddClass("disabled", IsDisabled)
5859
.AddClassFromAttributes(AdditionalAttributes)
5960
.Build();
6061

src/components/BootstrapBlazor.Region/Components/Region.razor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ export function init(id) {
66
if (el === null) {
77
return
88
}
9-
const popover = Popover.init(el);
9+
const popover = Popover.init(el, {
10+
isDisabled: () => {
11+
return el.querySelector('.dropdown-toggle').getAttribute('disabled') === 'disabled'
12+
}
13+
});
1014

1115
Data.set(id, { el, popover });
1216
}

0 commit comments

Comments
 (0)