mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-17 03:25:19 +00:00
Merge pull request #2322 from obrenckle/menus_overlap
Close dropdown menu when opening one of its modal
This commit is contained in:
commit
43202f5bb7
2 changed files with 6 additions and 5 deletions
|
@ -67,7 +67,7 @@ details.dropdown .dropdown-menu a:focus-visible {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 100;
|
z-index: 35;
|
||||||
}
|
}
|
||||||
|
|
||||||
details .dropdown-menu > * {
|
details .dropdown-menu > * {
|
||||||
|
|
|
@ -38,11 +38,12 @@ let BookWyrm = new (class {
|
||||||
.querySelectorAll("[data-modal-open]")
|
.querySelectorAll("[data-modal-open]")
|
||||||
.forEach((node) => node.addEventListener("click", this.handleModalButton.bind(this)));
|
.forEach((node) => node.addEventListener("click", this.handleModalButton.bind(this)));
|
||||||
|
|
||||||
document
|
document.querySelectorAll("details.dropdown").forEach((node) => {
|
||||||
.querySelectorAll("details.dropdown")
|
node.addEventListener("toggle", this.handleDetailsDropdown.bind(this));
|
||||||
.forEach((node) =>
|
node.querySelectorAll("[data-modal-open]").forEach((modal_node) =>
|
||||||
node.addEventListener("toggle", this.handleDetailsDropdown.bind(this))
|
modal_node.addEventListener("click", () => (node.open = false))
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector("#barcode-scanner-modal")
|
.querySelector("#barcode-scanner-modal")
|
||||||
|
|
Loading…
Reference in a new issue