by capableweb · 3y ago · 0 comments
If the application you're using (the one(s) you're referring to when you say "cloud applications") is sending the key input to the backend and waits to render it client-side until it received a response, it's doing something horribly wrong and if that's how they write things, you probably want to avoid that for a multitude of reasons. Please name and shame though, so others can avoid it too :)
Same goes for Electron-based applications, there is no reason they'd block showing the text you inputted, and if they just use <input/> without doing anything egregious, you really shouldn't be able to type faster than characters appearing on the screen, something is really, really wrong then, and I don't think it's because of Electron.
I'm 99% sure nobody does that, that would be insane :D.
It's most likely caused by React and the use of controlled input components without thinking about performance. If your input sets it's value from React state, then you're updating the state on every keypress and re-rendering the component. In the most simple case, it's probably fine. But depending on your component hierarchy, it's pretty easy to end up in situation with over 50ms of typing latency.
I imagine you haven't seen how people implement autocomplete on web forms ;).
I agree, hence the surprise!
Although parent explicitly calls out "cloud applications" so I'm guessing online has something to do with it.
And in the context of online/offline, it wouldn't matter if it's internet connected or not, using controlled input components with state changes going through a deep hierarchy would introduce that sort of delay no matter if you're online or offline.
MS Teams does this when starting a new chat - you select the recipient and start typing and Teams will do two unexpected things shortly afterwards:
1) Clear the text you typed, and
2) Reset the cursor to the start of the line[0] https://github.com/microsoft/vscode/issues/161622#issuecomme...
On desktop applications they may lack in the response on the screen if they or the computer are to slow, but with cloud apps sometimes keystrokes go missing and the entered data is in the wrong field.
The operating system recognises all keystrokes, but the browser seems to skip some.