stop refresh when workflow dispatch is being used

This commit is contained in:
Mathieu Fenniak 2025-03-27 19:37:03 -06:00 committed by Gusted
parent 5c4265e743
commit d8af31c8cb

View file

@ -18,12 +18,14 @@
<script type="text/javascript">
// Intent: If the "Actor" or "Status" dropdowns are currently open and being navigated, the htmx refresh would replace
// them with closed dropdowns. Instead this prevents the list refresh from occurring while those dropdowns are open.
// Intent: If the "Actor" or "Status" dropdowns are currently open and being navigated, or the workflow dispatch
// dropdown form is open, the htmx refresh would replace them with closed dropdowns. Instead this prevents the list
// refresh from occurring while those dropdowns are open.
//
// Can't inline this into the `hx-trigger` above because using a left-brace ('[') breaks htmx's trigger parsing.
function noActiveDropdowns() {
return document.querySelector('[aria-expanded=true]') === null;
return document.querySelector('[aria-expanded=true]') === null &&
!document.querySelector('#branch-dropdown-form').checkVisibility();
}
</script>