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
Textfield swallowing chars when typing rapidly (only on server, not on wasm) #1012
Comments
Seems to only happen on ServerSide Blazor or? |
Yes, doesn't happen on WASM. |
To see it easily, just drop a chunk of text into any autocomplete field on https://mudblazor.com/components/autocomplete and just hold backspace. The cursor goes crazy. |
Textfield the same. It is NOT an autocomplete problem because autocomplete uses the textfield |
@henon I just try on mudblazor.com and I have the issue on Autocomplete only. |
@Garderoben This is a really annoying widely reported bug which I don't think should be pushed too far into the Future IMO. We should try and fix this as soon as we can. |
Since Mike switched our docs server to hybrid (hosted wasm) I can't reproduce it any more, neither for textfield nor for autocomplete. EDIT: Wrong, I set back to before the change to hybrid and tried with pure server. Can't reproduce it locally!! |
But it still happens on mudblazor.com so this is a bug that is impossible to fix for me. If I can't reproduce locally I can't test whether my changes fix the bug. EDIT: spoke too soon. It can be reproduced locally by switching to low-tier device in chrome's debugger tools |
I am proud to announce that after 5 hours of tinkering I fixed this with a most elegant solution. The problem was that on slow computers or with high network latency a two-way bound value update coming from a MudInput travelled to the bound partner and came back to the original input which of course had already a newer value due to continued typing. The old value which was travelling and coming back to the sender due to two-way sync, however, then overwrites the new value from the user input. That resulted in seemingly swallowed characters. They were overwritten by a render update of the input. The solution is simple. I track the focused state of an input by keeping a flag _isFocused which will be set true on input and false if OnBlur fires. While the input is focused it refuses to re-render. That solves the problem and allows the input to be updated by two-way binding in other situations where it is not focused. |
see #1228 |
…1012 #2136) * wip: numerical input rework * allow delete * wip numerical field rework * NumericField: heed the Culture property inherited by BaseInput * revert bad numerical input changes * show spin buttons on nu,erical field * default hide spin on non numerical inputs * NumericField: added documentation example * support inputmode and pattern on inputs * NumericField: pretty much arrived at the same conclusion as JArleth, up/down arrow keys work now. * Autocomplete: solved problem that caused test to fail * MudInput: verified that issue #1012 is not happening any more with text update prevention! * NumericField: stripping input of invalid chars both in normal and immediate mode * NumericInput: using arrow up/down keyboard keys will force a value update first * Moved InputType out of BaseInput * Moved Clearable out of BaseInput * Textfield: Added an example for clearable text field * cleanup debug logs * NumericField: Fixed up/down keys on BSS (not working at all on WASM) * NumericField: restricting a hack to BSS (WASM doesn't need it) * NumericField: allow increment/decrement on wasm * Nmeric field: support negative values * NumericField: culture unit test * NumericField: Cuture test fix * NumericField: Added an ArrowUp/Down keyboard test * NumericalField: illegal chars test * Improved on the illegal chars test Co-authored-by: Meinrad Recheis <meinrad.recheis@gmail.com>
…or#1012 but some still want to turn it off)
* TextField: added Clear() method which works even while focused * All inputs: make TextUpdateSuppression configurable (it fixes #1012 but some still want to turn it off) * BaseInput: made ForceRender() more potent * TextField: added a test for the TextUpdateSuppression parameter
Still an issue in 2023. Just paste the following text to try.mudblazor.com
|
@mynkow no, this is an autocomplete issue not a textfield issue and also it does not happen if you remove the keyup handler so this is an entirely different thing from the original post. Proof: https://try.mudblazor.com/snippet/QumdadbEpZEotNvD |
Describe the bug
This can be seen on mudblazor.com, type in the debounce example, type FAST! it will drop some chars.
related issues: #897
The text was updated successfully, but these errors were encountered: