radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.64k stars 816 forks source link

RadzenDataGrid Numeric Advanced Filter Input Issues #1787

Closed kerajel closed 2 weeks ago

kerajel commented 3 weeks ago

To reproduce Open https://blazor.radzen.com/datagrid?theme=material3 Open IQueryable or LoadDataEvent DataGrid demo (I think it would be reproduceable on any demo) Make ID column filterable Open the advanced filter on ID column Press and hold any number (say, 1) as if you tried to submit a long input '1111111111'

Actual result The input loses responsiveness (entire page freezes) and becomes stuck with '1111' or '111' input, unfreezes after a second Same glitchy behavior if you input '1111111111' and then keep backspace pressed to delete it

Expected result The input does not freeze and behaves as smoothly as a text input (in the same demo press and hold 'd' when filtering by First Name - observe that filter input smoothy gets filled up with 'd' characters)

I actually noticed that something is wrong with the numeric input looking at our MVP stand, but in our case the issue is different, below is the gif when I try to input '123' and then delete it. Notice how numbers disappear and sometimes I end up with '13' or '12'. Once again, the input in the advanced for text fields works without any issues.

Recording 2024-11-13 221621 (1)

Radzen.Blazor" Version=5.5.5 Windows 11 Google Chrome Version 130.0.6723.117 (Official Build) (64-bit)

kerajel commented 2 weeks ago

Update: the issue is not reproduced if I switch grid to FilterMode.SimpleWithMenu, so it looks like only advanced filter is affected

I also noticed that advanced filter clears your input if it exceeds int32.MaxValue which is not observed with FilterMode.SimpleWithMenu

enchev commented 2 weeks ago

Indeed the Numeric component in advanced filter will validate the number as you type while in simple mode the validation will happen on blur - this is how the DataGrid filtering is implemented and we don't plan to change that.

kerajel commented 2 weeks ago

@enchev I don't understand it; I've submitted two different pieces of evidence showing the negative impact of the current implementation on the input, yet you say this is expected. Did you view the .gif in my first post? Do the numbers disappearing and jumping erratically align with the project's objectives and the overall direction of the Radzen?

enchev commented 2 weeks ago

If you do not like the default behavior you can always define your own FilterValueTemplate for this column where you can use Numeric with desired settings.

delyaKh commented 2 weeks ago

@enchev, I had never noticed before, but our grids with advanced numeric filters have the same input issue—the digits are lost or disappear and reappear if you type a number quickly. The only solution is to type slowly.

Why is this considered expected behavior?