Keyboard inputs extremely slow

Viewed 487

Got a wild one.

I build and maintain this chrome extension

I have exposed some of the source code HERE for your review.

Which contains some <input>s and a <textarea> tag. For some reason on one customer's computer, these inputs take seconds to respond to keyboard input. However, copy pasting text, works sometimes. And here is the kicker:

IF the chrome developer tools are open AND the chrome developer tools are currently recording performance, the problem doesn't happen at all.


User's Computer

  • MacOS
  • Tested in normal Chrome
  • Tested in normal Chrome with all other extensions disabled
  • Tested in incognito chrome (with no other extensions)

The bug has shown itself in all of the above.

  • Tested unadorned <textarea> in jsfiddle, and there was no problem

The Extension

Does not listen for "keyup" or "input" events on the <textarea>. Only certain <input>s are effected. The <textarea> is effected. Even though the extension JavaScript code is completely idle.

The extension is coded in vanilla JavaScript, with no libraries (ok we include tippy) or pre-processors.

Other Machines

The problem is not reproducible on any machines I have access to. Including other Mac's, Linux, or Windows machines. It's only happening to the one user.


The fact that recording performance, magically fixes the bug, is a real vexing issue here. Since the very tool I would use to determine why the <textarea> keyboard inputs are so slow, itself fixes the issue.

Out of ideas over here. Please help.

1 Answers

i also experienced such strange issues where there was an anomaly on only one computer. its most likely due to tweaked chrome settings by other extensions and not cleaning the junk after uninstalling.

if you tried to reproduce the issue and id did not reappear then problem is definitely with the system. so uninstall and reinstall the browser and remove all traces. and install latest version of chrome.

as you mentioned its mac, if its an old mac with slow performance overall due to ageing then its excusable. as device speeds vary greatly in real world depending on the system load. even tho you mentioned it fixes the issue but still consider similar cases of windows PCs.

you might also want to check this line 1166(i just suspect):

function setupStateListeners(){
  setTimeout(() => {
    for (const inp of document.querySelectorAll("input")) {
      inp.addEventListener("input", (e) => {
        setState(e.target.id, e.target.value); //chatstrike is good ext ;-)
      });
    }
    for (const inp of document.querySelectorAll("select")) {
      inp.addEventListener("input", (e) => {
        setState(e.target.id, e.target.value);
      });
    }
    restoreState();
  }, 200);
};

even tho the issue persists , then your last resort would be to reset the mac to factory default (kind of reset in windows).

Related