RadzenDropDown: LoadData called twice on filter and once again on blur/focus #1869

Closed
opened 2026-01-29 17:59:35 +00:00 by claunia · 4 comments
Owner

Originally created by @k-Sacr on GitHub (Sep 25, 2025).

Describe the bug
When filtering in RadzenDropDown, the data loading method (LoadData) is called twice for a single Filter input change. Based on the logs it seems the calls are executed on different threads.
Additionally, when the filter input loses focus (blur), the data loading method is triggered again even though the filter value did not change. This seems unintended.

To Reproduce
Steps to reproduce the behavior:

  1. Open a page example with /dropdown-filtering bound via LoadData.
  2. Set a breakpoint in the method that is called when loading data.
  3. Type a value in a filter input.
  4. Observe in the logs that LoadData is called twice (in different threads).
  5. Click outside of the filter input (blur event).
  6. Observe that LoadData is called again unexpectedly.

Expected behavior

  • LoadData should be called only once per filter change.
  • Losing focus from the filter input should not trigger LoadData unless explicitly configured.

Screenshots / Video

https://github.com/user-attachments/assets/1e4224f5-8bf6-4087-b791-a00145398e1d

Attached video demonstrates:

  • Double LoadData calls after typing.
  • Additional LoadData call after filter input loses focus.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome 129
  • Radzen Blazor DataGrid version: 7.4.1

Additional context
It would be helpful to introduce a flag or configuration option to suppress the LoadData call on blur of filter inputs.

Originally created by @k-Sacr on GitHub (Sep 25, 2025). **Describe the bug** When filtering in RadzenDropDown, the data loading method (`LoadData`) is called twice for a single Filter input change. Based on the logs it seems the calls are executed on different threads. Additionally, when the filter input loses focus (blur), the data loading method is triggered again even though the filter value did not change. This seems unintended. **To Reproduce** Steps to reproduce the behavior: 1. Open a page example with /dropdown-filtering bound via `LoadData`. 2. Set a breakpoint in the method that is called when loading data. 3. Type a value in a filter input. 4. Observe in the logs that `LoadData` is called twice (in different threads). 5. Click outside of the filter input (blur event). 6. Observe that `LoadData` is called again unexpectedly. **Expected behavior** - `LoadData` should be called only once per filter change. - Losing focus from the filter input should not trigger `LoadData` unless explicitly configured. **Screenshots / Video** https://github.com/user-attachments/assets/1e4224f5-8bf6-4087-b791-a00145398e1d Attached video demonstrates: - Double `LoadData` calls after typing. - Additional `LoadData` call after filter input loses focus. **Desktop (please complete the following information):** - OS: Windows 10 - Browser: Chrome 129 - Radzen Blazor DataGrid version: 7.4.1 **Additional context** It would be helpful to introduce a flag or configuration option to suppress the `LoadData` call on blur of filter inputs.
Author
Owner

@joriverm commented on GitHub (Sep 26, 2025):

just to see if this is what i had noticed last week, is it being called with the same filter/arguments both times?

@joriverm commented on GitHub (Sep 26, 2025): just to see if this is what i had noticed last week, is it being called with the same filter/arguments both times?
Author
Owner

@joriverm commented on GitHub (Sep 26, 2025):

looks like its called twice. once from OnFilter and once from OnKeyPress
and #2302 happens on the execution of OnFilter, curious.

@joriverm commented on GitHub (Sep 26, 2025): looks like its called twice. once from `OnFilter` and once from `OnKeyPress` and #2302 happens on the execution of OnFilter, curious.
Author
Owner

@joriverm commented on GitHub (Sep 29, 2025):

@k-Sacr / @enchev : this seems to happen because of the OnKeyDown event handler + the OnChange event handler in the search input field : https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/RadzenDropDown.razor#L152-L155

i was playing around and i think adding a debounce to OnFilter may fix this, but i dont feel good with that change. any recommendations? is OnChange even needed since its now basically triggering on key input and on focus loss/blur? removing the onchange, and therefor the dubbel trigger, does help it speed up though.

ill be testing some stuff locally together with my fix for #2302

@joriverm commented on GitHub (Sep 29, 2025): @k-Sacr / @enchev : this seems to happen because of the OnKeyDown event handler + the OnChange event handler in the search input field : https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/RadzenDropDown.razor#L152-L155 i was playing around and i think adding a debounce to `OnFilter` may fix this, but i dont feel good with that change. any recommendations? is OnChange even needed since its now basically triggering on key input and on focus loss/blur? removing the onchange, and therefor the dubbel trigger, does help it speed up though. ill be testing some stuff locally together with my fix for #2302
Author
Owner

@joriverm commented on GitHub (Oct 1, 2025):

thanks for the merge/fix @enchev ^^

@joriverm commented on GitHub (Oct 1, 2025): thanks for the merge/fix @enchev ^^
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1869