JSFiddle - React, Tailwind, and code Playground

HTML

<div id="opener">Open</div>
<div id="submenu">
    <ul>
        <li><a href="#">New</a></li>
        <li><a href="#">Open</a></li>
        <li><a href="#">Save</a></li>
        <li><a href="#">Help</a></li>
    </ul>
    <input type="file" />
</div>
<br /><hr /><br />
Click "Open" above to open a sub menu. Then, clicking the File input will also hide the open submenu b/c the window has blurred.

JavaScript

document.getElementById('opener').onclick = function(){
    document.getElementById('submenu').style.display = 'block';
}