Backporting for LTS 2.516.1 (part 2) (#10822)
Label conflicting PRs / main (push) Has been cancelled Details

This commit is contained in:
Mark Waite 2025-07-10 08:18:53 -06:00 committed by GitHub
commit fe37c57d58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 9 deletions

View File

@ -36,15 +36,21 @@ function dropdown() {
animation: "dropdown",
duration: 250,
onShow: (instance) => {
// Make sure only one instance is visible at all times
const dropdowns = document.querySelectorAll("[data-tippy-root]");
Array.from(dropdowns).forEach((element) => {
// Check if the Tippy.js instance exists
if (element && element._tippy) {
// To just hide the dropdown
element._tippy.hide();
}
});
// Make sure only one instance is visible at all times in case of breadcrumb
if (
instance.reference.classList.contains("hoverable-model-link") ||
instance.reference.classList.contains("hoverable-children-model-link")
) {
const dropdowns = document.querySelectorAll("[data-tippy-root]");
Array.from(dropdowns).forEach((element) => {
// Check if the Tippy.js instance exists
if (element && element._tippy) {
// To just hide the dropdown
element._tippy.hide();
}
});
}
const referenceParent = instance.reference.parentNode;
if (referenceParent.classList.contains("model-link")) {