JSFiddle - React, Tailwind, and code Playground

HTML

<input id="inp1" type="text">
<input id="inp2" type="text">

<ol>
<li>Type quickly in 'inp1' and tab to 'inp2'</li>
<li>Check console; last x key presses are registered from 'inp2' element, but characters remain in 'inp1'</li>
</ol>

JavaScript

document.getElementById('inp1').onkeyup = function(e) {
  console.log(this.id + ' ' + e.which);
}
document.getElementById('inp2').onkeyup = function(e) {
  console.log(this.id + ' ' + e.which);
}