Cms: Typing in the content editor feels laggy while using Safari

Created on 4 Jan 2020  Â·  19Comments  Â·  Source: statamic/cms

While using Safari, typing in the content editor feels laggy (delayed response while typing). While using Chrome on the same machine, the content editor doesn't feel laggy.

Specs:

Safari 13.0.4
Running OSX 10.15.2
MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)
Processor: 1.4 GHz Quad-Core Intel Core i5
Memory: 16 GB 2133 MHz LPDDR3

browser bug

All 19 comments

Which fieldtype? Bard? Markdown?

Bard & Markdown both exhibit this for me.

Sorry Jack, I've experienced it in Bard and Textarea so far. I tried to find an easy way to capture it to show what I mean, but it's hard to capture a feeling. Here's the best I could do:

  • I took a screen recording of myself typing "One two three" (I made a typo so it ended up as "One two tthree")
  • I then took a second screen recording as I scrubbed through the first recording one frame at a time

statamic-laggy-typing 2020-01-04 19_04_33

  • So the first 5 characters are fine: "One t"
  • Then instead of getting a frame for "w" and another for "o", we got a bit of a delay and then both "wo" appear together in the next frame
  • The next characters " t" go through fine
  • Then I make the typo, but the lag happens again for characters "th" where they both appear in the same frame.

Hopefully that helps!

FWIW I don't seem to experience this. macOS Catalina 10.15.2. Have you tried disabling browser extensions? Some are very aggressive with forms and can do odd things—LastPass comes to mind.

Yeah I was just about to ask, do you have any extensions enabled?

I do, I'll disable and re-test

I only had 1Password installed. Disabled it and still experienced it. Worth noting that on a more powerful machine, it doesn't seem to be as noticeable.

and I'm on an underpowered 2017 MacBook

I disabled all my extensions and it is still laggy for me.

Do you have devtools open? Is it any better with them closed?

I do not have dev tools open. No lag in Firefox.

I took a look and EQCSS is causing this issue, in particular, it's the throttling feature. It's a performance issue not exclusive to one browser and it's causing a forced reflow, resulting in high CPU load.

Every time you input, it's calling EQCSS.throttle.


Default. (Throttle 200ms. Input throttle enabled)
default


Throttle 2s. Input throttle enabled
2 second throttle


Throttle 200ms. Input throttle disabled.
no input throttle

@JonKaric how were you able to determine it was eqcss.throttle on input that was causing the reflow?

@jackmcdade It was EQCSS causing the reflow, can't confirm it was eqcss.throttle but that was the root of the janky-ness for me. Happens when you interact with the page too, but it's not as bad.

Chrome dev tools > Performance > Record the page / whilst typing > Open the main tab

I'm experiencing this problem too. I'm using a very long document and there's like a ~1 to 2 second lag after each key press, so it's not really usable at the moment.

@jackmcdade This still happens on the latest beta, 3.0.0-beta.27. I found this page to be really useful.

If you're only using it to control the width of the .publish-field(s) based on the parent width, then you can do away with everything except the resize listener because that's the only one that will affect the widths of the fields.

The fields have set widths anyway, so typing content (listening for input) is redundant. The same with mousedown, mouseup, mousemove. You may need click somewhere for stacksâ„¢ or something? I'm not sure.

@jackmcdade We are severely affected by this problem too. Big input lag on everything from bard editor, toogles, selects and so on.

Only happens when the blueprints require a lot input fields. Happens on all tested browsers and devices.

here is a gif of it, where only on whole word is appearing at a time due to lag :)

Screen Recording 2020-06-12 at 3 53 29 PM

This may be related to #1915

@JonKaric Thanks for that link. Do you actually see a way to disable certain events?

Locally I've brought eqcss inline and simply commented out the input event binding. It seems to help quite a bit. It would be nice if there was a setting I could use instead of having to "fork" the project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ReneWeCode picture ReneWeCode  Â·  3Comments

riasvdv picture riasvdv  Â·  4Comments

dakisan picture dakisan  Â·  4Comments

filipac picture filipac  Â·  4Comments

AndreasSchantl picture AndreasSchantl  Â·  3Comments