JSFiddle - React, Tailwind, and code Playground
HTML
<div class="bug">
<p>Strange behaviour in Chrome/JQuery. Hover over this div, then move the mouse into the input area that becomes visible. In Chrome, the input flickers and isn't selectable as the hover is continually added and removed.</p>
<div class="input-container">
<input type="text" value="text"/>
</div>
</div>
<p> </p>
<div class="workaround">
<p>Workaround attempt. This uses add/remove rather than toggle, to prevent confusion as the hover is cancelled strangely, and the hover event of the child input retains the class that is removed by the end hover on the parent.</p>
<div class="input-container">
<input type="text" value="text"/>
</div>
</div>
CSS
.bug, .workaround { border: solid 1px blue; }
.input-container {display: none;}
.show { border: solid 1px red; }
.show .input-container {display: block;}
JavaScript
$('div.bug').hover(
// using a single handler with toggleClass() has the same effect
function() { $(this).addClass('show'); },
function() { $(this).removeClass('show'); });
// testing a workaround
$('.workaround').hover(
function() { $(this).addClass('show'); },
function() { $(this).removeClass('show'); });
$('.workaround input').hover(function(event) {
$(this).closest('.workaround').addClass('show');
}, $.noop);