JSFiddle - React, Tailwind, and code Playground
HTML
<input id="a" value="a" />
<input id="b" value="b" />
<div class="console"></div>
JavaScript
var a = document.getElementById("a");
var b = document.getElementById("b");
function show(elem) {
elem.style.display = 'inline-block';
}
function hide(elem) {
elem.style.display = 'none';
}
a.onfocus = function() {show(b);};
a.onblur = function() {
setTimeout(function() {
if(document.activeElement !== b && document.activeElement !== a){
hide(b);
}
}, 0);
};
b.onblur = a.onblur;