Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadzenDataFilter numeric input fixes #1843

Closed
wants to merge 3 commits into from

Conversation

kerajel
Copy link
Contributor

@kerajel kerajel commented Dec 8, 2024

I wish there was a better way to fix these issues, but since the numeric input relies on the 'onchange' event and not on the 'oninput' event it's hard to come up with something. If there is a better way to force an input to 'commit' its changes into the 'onchange' event on demand, it'd be best to use it, but I am not aware of other solutions.

Resolving #1818
blurAllNumericInputs - this functions should be called from client's code right before you want to read RadzenDataFilter<>.ToFilterString();

Resolving #1842
Reference the new OnFilterOperatorChanged method (its logic was inlined before). The loss of values occurs at the await InvokeAsync(ChangeState); because the 'onchange' event of the corresponding numeric input has not committed and server-side DOM is not aware of user's input. Temporarily stashing the current input values and then restoring them resolves the issue. Other blurring techniques did not work in this case.

@enchev
Copy link
Collaborator

enchev commented Dec 9, 2024

I don't think that we should merge this code - the DataGrid filtering should not mess with all input components in the current page in first place. I still believe that handling internally oninput is the only reliable way to avoid such problems with Blazor server lag:
124033d

@enchev enchev closed this Dec 9, 2024
@kerajel
Copy link
Contributor Author

kerajel commented Dec 9, 2024

@enchev, but how would I handle the 'oninput' if the numeric input uses 'onchange'?

@enchev
Copy link
Collaborator

enchev commented Dec 9, 2024

Check the code I’ve linked. Both can coexist.

@enchev
Copy link
Collaborator

enchev commented Dec 9, 2024

Here is what I'm referring:
1a40da9

@kerajel kerajel deleted the kerajel/numeric-input-fixes branch December 11, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants