Merge pull request #2322 from obrenckle/menus_overlap

Close dropdown menu when opening one of its modal
This commit is contained in:
Mouse Reeve 2022-11-01 17:15:00 -07:00 committed by GitHub
commit 43202f5bb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -67,7 +67,7 @@ details.dropdown .dropdown-menu a:focus-visible {
align-items: center;
justify-content: center;
pointer-events: none;
z-index: 100;
z-index: 35;
}
details .dropdown-menu > * {

View file

@ -38,11 +38,12 @@ let BookWyrm = new (class {
.querySelectorAll("[data-modal-open]")
.forEach((node) => node.addEventListener("click", this.handleModalButton.bind(this)));
document
.querySelectorAll("details.dropdown")
.forEach((node) =>
node.addEventListener("toggle", this.handleDetailsDropdown.bind(this))
document.querySelectorAll("details.dropdown").forEach((node) => {
node.addEventListener("toggle", this.handleDetailsDropdown.bind(this));
node.querySelectorAll("[data-modal-open]").forEach((modal_node) =>
modal_node.addEventListener("click", () => (node.open = false))
);
});
document
.querySelector("#barcode-scanner-modal")