Skip to content

Commit 2ba8453

Browse files
authored
[JENKINS-75834] make sure only one instance of the dropdown is visible (#10786)
2 parents 7e707a2 + b97f1a0 commit 2ba8453

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/js/components/dropdowns/templates.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ function dropdown() {
3636
animation: "dropdown",
3737
duration: 250,
3838
onShow: (instance) => {
39+
// Make sure only one instance is visible at all times
40+
const dropdowns = document.querySelectorAll("[data-tippy-root]");
41+
Array.from(dropdowns).forEach((element) => {
42+
// Check if the Tippy.js instance exists
43+
if (element && element._tippy) {
44+
// To just hide the dropdown
45+
element._tippy.hide();
46+
}
47+
});
3948
const referenceParent = instance.reference.parentNode;
4049

4150
if (referenceParent.classList.contains("model-link")) {

0 commit comments

Comments
 (0)