JSFiddle - React, Tailwind, and code Playground

HTML

Click into this textarea. On focus, it claims it does not have focus. (Safari and Chrome only.)
<br>
<textarea id="hi" rows="6" cols="40">click here</textarea><br />
<input id="ho" type=text value="click here"/>

JavaScript

$('textarea, input').focus(function() {
    this.value = this.id+" "+
        (document.querySelector(":focus") || {}).id+" "+
        (document.activeElement || {}).id;
});