Dropdown prevent closing after click #2278
Unanswered
bastigerner
asked this question in
Q&A
Replies: 1 comment 3 replies
-
It is not possible currently with Blazorise. You could make it possible if you create a custom toggle button that you can use to toggle the menu. CustomDropdownToggle.razor <button type="button" class="@($"btn dropdown-toggle btn-primary {(ParentDropdown.Visible ? "show":"")}")" data-toggle="dropdown" aria-expanded="ParentDropdown.Visible" @onclick="@ClickHandler">
@ChildContent
</button>
@code{
[CascadingParameter] protected Dropdown ParentDropdown { get; set; }
Task ClickHandler(){
ParentDropdown?.Toggle();
return Task.CompletedTask;
}
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
is it possible to prevent a dropdown from closing after I have clicked something inside it?
I am trying to create a multiselect filter and want it to stay open until I click the DropdownToggle again.
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions