There is a <input type="text"> . The problem is that after triggering keyboard events (say Enter key, or another character key) and then immediately click (Touchpad) on input, the event loop does not catch mouse events. Starts to catch after a delay of ~ 800 ms.
var el = document.getElementById('keyboard'); var prevTime = new Date().getTime(); el.addEventListener('keyup', () => { console.log('keyup'); var curTime = new Date().getTime(); console.log(curTime - prevTime); prevTime = curTime; }, false); el.addEventListener('mousedown', () => { console.log('mousedown'); var curTime = new Date().getTime(); console.log(curTime - prevTime); prevTime = curTime; }, false); <input type="text" id="keyboard"> Interesting moments, the delay occurs only character keys and only on the Touchpad.
OS: Windows 10,
Chrome: 68.0.3440
Why can the event loop not immediately catch the event?
