I have a table inside which on each row I have options inside a dropdown. When I click on the options, the dropdown opens (show class applied). When I hover on other rows while the dropdown is open, it disappears (although the show class stays) and when I hover back on the existing row, it appears again.
I wish to do either of these 2 things:
- The dropdown should not disappear even if I hover out of that particular row.
- The dropdown should close once I hover out of the row.
I tried this code but failed:
$('#people-area-list tr').on('mouseleave', function () {
var x = $(this).children('.action-btns .dropdown');
x.removeClass('show');
});
HTML is:
<div class="dropdown">
<a href="#" id="edit-submenu" data-toggle="dropdown">Options</a>
<div class="dropdown-menu" aria-labelledby="edit-submenu">
<a onclick="managePermission()" href="javascript:void(0);">Manage permissions</a>
<a href="#">Reset password</a>
<a href="#" onclick="deleteModal(@userId,' @fullName ')">Delete User</a>
</div>
</div>