mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
trigger close whenever focus leaves accordion
This commit is contained in:
parent
11f90ea28a
commit
a2f04515f4
1 changed files with 16 additions and 5 deletions
|
@ -1248,10 +1248,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
domainsSearchInput.addEventListener('focus', function(e) {
|
// domainsSearchInput.addEventListener('focus', function(e) {
|
||||||
console.log('focus');
|
// console.log('focus');
|
||||||
closeFilters();
|
// closeFilters();
|
||||||
});
|
// });
|
||||||
|
|
||||||
domainsSearchSubmit.addEventListener('click', function(e) {
|
domainsSearchSubmit.addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -1337,7 +1337,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
loadDomains(1, 'id', 'asc');
|
loadDomains(1, 'id', 'asc');
|
||||||
resetHeaders();
|
resetHeaders();
|
||||||
updateStatusIndicator();
|
updateStatusIndicator();
|
||||||
closeFilters();
|
//closeFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resetFiltersButton) {
|
if (resetFiltersButton) {
|
||||||
|
@ -1357,6 +1357,17 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener('focusin', function(event) {
|
||||||
|
const accordion = document.querySelector('.usa-accordion--select');
|
||||||
|
const accordionIsOpen = document.querySelector('.usa-button--filter[aria-expanded="true"]');
|
||||||
|
|
||||||
|
if (accordionIsOpen && !accordion.contains(event.target)) {
|
||||||
|
console.log('trigger')
|
||||||
|
closeFilters();
|
||||||
|
toggleCaret(statusToggle);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Load the first page initially
|
// Load the first page initially
|
||||||
loadDomains(1);
|
loadDomains(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue