ToggleButton in DropDownItems do not work with Custom filter with Load Data event #1645

Closed
opened 2026-01-29 17:56:40 +00:00 by claunia · 2 comments
Owner

Originally created by @andreasmuellergin on GitHub (Feb 27, 2025).

Hi dear Radzen Team, Thanks for your work!!!

I think i have found an issue in one of our DropDowns when putting buttons inside the DropdownItem Template.
I managed to reproduce it in the Blazor Component Demos.

Happy Case:
Inside the code of [Filtering case sensitivity and filter operator] in dropdown filtering demo
Specify the DropDownItem Template as:
<RadzenDropDown ...> <Template><RadzenToggleButton @onclick:stopPropagation/></Template> </RadzenDropDown>
Result:

  • when opening the dropdown, the single visible element item button can be toggled (good)
  • when changing the filter text, any visible element item button can be toggled (good)

Unhappy Case:
Inside the code of Custom filtering with LoadData event
Set the same as the DropDownItem Template:
<RadzenDropDown ...> <Template><RadzenToggleButton @onclick:stopPropagation/></Template> </RadzenDropDown>
Result:

  • when opening the dropdown, all visible element item buttons can be toggled (good)
  • when changing the filter text, none of the visible element item buttons can be toggled (bad)

It seems like the combination of Filtering and retrieving through the LoadData event leads to the ItemTemplate not consuming the click in the same way all other dropdown scenarios do.

So the questions basically are:

  1. Am i using the DropDown Template incorrectly, am i not supposed to put buttons, checkboxes, radios etc. inside?
  2. Can i workaround this issue without loosing AllowFiltering in connection with LoadDataEvent?

Thanks a lot in advance.

Any recommendation is highly appreciated.

Best regards, Andreas

Originally created by @andreasmuellergin on GitHub (Feb 27, 2025). Hi dear Radzen Team, Thanks for your work!!! I think i have found an issue in one of our DropDowns when putting buttons inside the DropdownItem Template. I managed to reproduce it in the Blazor Component Demos. Happy Case: Inside the code of [**Filtering case sensitivity and filter operator**] in [dropdown filtering demo](https://blazor.radzen.com/dropdown-filtering?theme=material3) Specify the DropDownItem Template as: ` <RadzenDropDown ...> <Template><RadzenToggleButton @onclick:stopPropagation/></Template> </RadzenDropDown> ` Result: * when opening the dropdown, the single visible element item button can be toggled (good) * when changing the filter text, any visible element item button can be toggled (good) Unhappy Case: Inside the code of [**Custom filtering with LoadData event**](https://blazor.radzen.com/dropdown-filtering?theme=material3#loaddata-event) Set the same as the DropDownItem Template: ` <RadzenDropDown ...> <Template><RadzenToggleButton @onclick:stopPropagation/></Template> </RadzenDropDown> ` Result: * when opening the dropdown, all visible element item buttons can be toggled (good) * when changing the filter text, none of the visible element item buttons can be toggled (bad) It seems like the combination of Filtering and retrieving through the LoadData event leads to the ItemTemplate not consuming the click in the same way all other dropdown scenarios do. So the questions basically are: 1. Am i using the DropDown Template incorrectly, am i not supposed to put buttons, checkboxes, radios etc. inside? 2. Can i workaround this issue without loosing AllowFiltering in connection with LoadDataEvent? Thanks a lot in advance. Any recommendation is highly appreciated. Best regards, Andreas
Author
Owner

@enchev commented on GitHub (Feb 28, 2025):

You can stop propagation of onmousedown as well:

https://github.com/user-attachments/assets/74967969-576c-4679-a1a8-a198aab275a5

@enchev commented on GitHub (Feb 28, 2025): You can stop propagation of onmousedown as well: https://github.com/user-attachments/assets/74967969-576c-4679-a1a8-a198aab275a5
Author
Owner

@andreasmuellergin commented on GitHub (Feb 28, 2025):

Thank you very much for the swift response. We'll give that a try.

@andreasmuellergin commented on GitHub (Feb 28, 2025): Thank you very much for the swift response. We'll give that a try.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1645