I’m not sure exactly when this started happening, but I’ve noticed a considerable input lag when typing a value with a global class selected.
Here’s an example of me pressing backspace and then typing a number:
When styling the block, it works perfectly. But when styling the global class, it doesn’t register me clicking backspace in time, and just continues to add on the numbers.
I can confirm this.
Added a template (Courbes) where the lag was present then.
Then deleted everything but a section with a heading and no issues anymore on the same block I tested before.
Feedback from a Windows user with ~2% CPU load.
Tested in Edge, Chrome, Firefox.
I have the strong feeling that it’s related to the logic which picks up the unit which is then displayed at the end of the input field.
For instance, I can enter a value of 3 and then wait a moment. So far so good. The issue occurs when the logic tries to find out which unit I’m about to type in.
When I enter, as an example, 3hhh (so the logic knows there is no natively supported unit to pick up), I can go wild on my keyboard without any issue.
Same goes for when the desired unit already has been entered or is the default one, so only digits are typed in.
The logic is pretty simple, and isn’t at fault here as much as the controlled components we have to use to set the value to the Redux store (the value isn’t just set through the input, but can be changed through number scrubbing but also direct store modification).
This is interesting because the function is continuously checking for a possible unit even if you have selected a unit.
While I was able to reproduce this on the global class example provided by @sunny, I could not get a single lag when editing block properties.
Thanks for all the insights @Louis - very interesting.
The lag basically kicked in when starting to type in a potential unit (first letter matches a unit inside the dropdown).
At least that’s my impression.
However, with the latest update it’s running buttery smooth - it’s a total different experience. Can’t confirm though that it’s related to the actual update, especially as you are mentioning that nothing has changed in that regard, if I got you right.
It might have other causes (like OS, etc.), but want to add that I tested things on different devices, different browsers, and on different server environments - however same OS.
If I run into it again, I’ll update with a screencast, so you get a better idea what’s happening on my side.