$(document).ready(function() {
$(document).on('focusout', '.dropdown', function(event) {
// setTimeout to run after the next element receives focus
setTimeout(() => {
// Check if the newly focused element is outside of this dropdown
if (!$.contains(this, document.activeElement)) {
$(this).removeClass('open');
}
}, 0);
});
});
-->