[JENKINS-75927] remove model-link--open onHide (#10931)

[JENKINS75927] remove model-link--open onHide

When a model-link is opened the link gets added a class that highlights
the link. Upon closing the menu (e.g. when clicking outside) the menu
disappears but the added class is not removed.

(cherry picked from commit aa1564ea4d)
This commit is contained in:
Markus Winter 2025-08-08 17:54:36 +01:00 committed by Hervé Le Meur
parent 00922a10bc
commit b54bd9670b
2 changed files with 2 additions and 4 deletions

View File

@ -57,10 +57,6 @@ function dropdown() {
referenceParent.classList.add("model-link--open");
}
},
onHide: (instance) => {
const referenceParent = instance.reference.parentNode;
referenceParent.classList.remove("model-link--open");
},
};
}

View File

@ -52,6 +52,8 @@ function generateDropdown(element, callback, immediate, options = {}) {
}
},
onHide(instance) {
const referenceParent = instance.reference.parentNode;
referenceParent.classList.remove("model-link--open");
if (
instance.props.trigger === "mouseenter" &&
!instance.clickToHide