JSFiddle - React, Tailwind, and code Playground
HTML
<div class="basket">
<a href="/basket" class="basket-a" title="Товары в корзине">
hover сюда
</a>
<form class="modal-basket"> </form>
</div>
CSS
.modal-basket {
width: 250px;
height: 200px;
display: none;
z-index: 100;
background-color: #FFF;
border: 1px solid red;
}
JavaScript
$('.basket-a').hover(function(){
$('.modal-basket').show();
})
$(document).hover(function(event) {
if ($(event.target).closest('.modal-basket').length || $(event.target).closest('.basket-a').length ) return;
$('.modal-basket').fadeOut(500);
event.stopPropagation();
});