Skip to content

Commit fb09391

Browse files
committed
refactor: 增加样式
1 parent c33b248 commit fb09391

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public partial class SelectCity
1717

1818
private string? InputId => $"{Id}_input";
1919

20-
private string? ClassString => CssBuilder.Default("select bb-region")
20+
private string? ClassString => CssBuilder.Default("select bb-city")
2121
.AddClass("disabled", IsDisabled)
2222
.AddClassFromAttributes(AdditionalAttributes)
2323
.Build();
2424

2525
private readonly HashSet<string> _values = [];
2626

27-
private string? GetActiveClass(string item) => _values.Contains(item) ? "active" : null;
27+
private string? GetActiveClass(string item) => _values.Contains(item) || CurrentValue == item ? "active" : null;
2828

2929
private async Task OnClearValue()
3030
{

src/components/BootstrapBlazor.Region/Components/SelectCity.razor.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
.dropdown-menu {
1+
.bb-city {
2+
position: relative;
3+
}
4+
5+
.bb-city:not(.disabled):hover .form-select-append {
6+
display: none;
7+
}
8+
9+
.dropdown-menu {
210
--bs-dropdown-padding-y: .5rem;
311
--bs-dropdown-padding-x: .5rem;
412
max-width: 400px;

0 commit comments

Comments
 (0)