JSFiddle - React, Tailwind, and code Playground
HTML
<div id="extra"></div>
<input type="file" id="test">
<p>
To reproduce error - Click on the input box portion of the file input and select any file
</p>
JavaScript
var test = document.getElementById("test");
test.addEventListener("focus", onfocus);
test.addEventListener("change", onchange);
function onfocus(event) {
console.log(document.activeElement === test, document.activeElement);
}
function onchange( event ) {
// to show the bug in http://jqbug.com/ui/8288
var active = document.activeElement,
extra = document.getElementById("extra");
console.log( "change:", active );
extra.appendChild( test );
// boom!
extra.contains( active );
}