The dropdown closes alone, the modal stays
Browse files at this commit20280ed445b7fad346027aa028cd0fefff23ee2aParent: 40d8e18- fix
- the dropdown closes alone, the modal stays
2 changed files +10 -5
crates/izlek-web/src/dropdown.rsmodified+9 -4
| @@ -18,9 +18,14 @@ use topcoat::view::{Unescaped, view}; | |||
| 18 | /// Emitted once per page that renders a `<select>`; the enhancement is | 18 | /// Emitted once per page that renders a `<select>`; the enhancement is |
| 19 | /// per-element and idempotent (`data-dd-done`), re-run on `izlek:wire` so | 19 | /// per-element and idempotent (`data-dd-done`), re-run on `izlek:wire` so |
| 20 | /// selects arriving in a soft page swap get theirs too. Owns its own | 20 | /// selects arriving in a soft page swap get theirs too. Owns its own |
| 21 | -/// `Escape` resolver on `window.__izlekEsc` (priority 50 — an open panel | 21 | +/// `Escape` resolver on `window.__izlekEsc` (priority 95 — the dropdown |
| 22 | -/// closes before the topbar and card-menu layers below it; the whole order | 22 | +/// outranks the modal chain: Escape on an open panel closes just the |
| 23 | -/// lives in the table on `layout.rs`'s `escape_manager_script`). | 23 | +/// panel, never the modal above it. The old per-script listeners made |
| 24 | +/// this order path-dependent — a modal swapped in by soft navigation | ||
| 25 | +/// registered its listener last and lost to the dropdown; a full load | ||
| 26 | +/// with `?task=` registered it first and the modal chain won, closing | ||
| 27 | +/// the whole modal over an open dropdown — the registry pins the correct | ||
| 28 | +/// order; the whole table lives in `layout.rs`'s `escape_manager_script`). | ||
| 24 | pub async fn dropdown_script(cx: &Cx) -> Result { | 29 | pub async fn dropdown_script(cx: &Cx) -> Result { |
| 25 | const JS: &str = "\ | 30 | const JS: &str = "\ |
| 26 | (function () {\ | 31 | (function () {\ |
| @@ -117,7 +122,7 @@ pub async fn dropdown_script(cx: &Cx) -> Result { | |||
| 117 | if (row) { pick(select, trigger, panel, row); }\ | 122 | if (row) { pick(select, trigger, panel, row); }\ |
| 118 | });\ | 123 | });\ |
| 119 | }\ | 124 | }\ |
| 120 | - window.__izlekEsc.register(50, function () {\ | 125 | + window.__izlekEsc.register(95, function () {\ |
| 121 | var panel = document.querySelector('.dd-panel.dd-open');\ | 126 | var panel = document.querySelector('.dd-panel.dd-open');\ |
| 122 | if (!panel) { return false; }\ | 127 | if (!panel) { return false; }\ |
| 123 | var trigger = panel.__ddTrigger;\ | 128 | var trigger = panel.__ddTrigger;\ |
crates/izlek-web/src/layout.rsmodified+1 -1
| @@ -295,8 +295,8 @@ pub async fn soft_nav_script(cx: &Cx) -> Result { | |||
| 295 | /// | 295 | /// |
| 296 | /// | prio | closes | registered by | | 296 | /// | prio | closes | registered by | |
| 297 | /// |------|--------|---------------| | 297 | /// |------|--------|---------------| |
| 298 | +/// | 95 | the open dropdown panel (refocusing its trigger) | `dropdown.rs`'s `dropdown_script` | | ||
| 298 | /// | 90 | the viewer, then the delete confirm, then non-datepick edit popovers, then the task modal | `detail.rs`'s `escape_closes` | | 299 | /// | 90 | the viewer, then the delete confirm, then non-datepick edit popovers, then the task modal | `detail.rs`'s `escape_closes` | |
| 299 | -/// | 50 | the open dropdown panel (refocusing its trigger) | `dropdown.rs`'s `dropdown_script` | | ||
| 300 | /// | 40 | the topbar `.user-menu` (pin+blur), then the rules composer, then a rules edit row (back to `/rules`) | `layout.rs`'s `escape_script` | | 300 | /// | 40 | the topbar `.user-menu` (pin+blur), then the rules composer, then a rules edit row (back to `/rules`) | `layout.rs`'s `escape_script` | |
| 301 | /// | 20 | the datepicker popover | `board.rs`'s `card_menu_script` | | 301 | /// | 20 | the datepicker popover | `board.rs`'s `card_menu_script` | |
| 302 | /// | 10 | the card context menu | `board.rs`'s `card_menu_script` | | 302 | /// | 10 | the card context menu | `board.rs`'s `card_menu_script` | |