fix(popover): DLT-3601 scope modal z-index bump to the anchor's own modal - #1410
Draft
Brad Paugh (braddialpad) wants to merge 1 commit into
Draft
fix(popover): DLT-3601 scope modal z-index bump to the anchor's own modal#1410Brad Paugh (braddialpad) wants to merge 1 commit into
Brad Paugh (braddialpad) wants to merge 1 commit into
Conversation
…odal calculateAnchorZindex promoted a popover from the popover layer (300) to the modal-element layer (650) whenever a document-wide querySelector found any open modal. That cannot distinguish a popover nested inside the open modal, which should outrank it, from unrelated global chrome such as the profile menu that merely happens to be open at the same time. The latter ended up painting above the dimming overlay of a modal it has nothing to do with. Test the popover's own anchor with closest() instead, so only popovers that actually live inside an open modal are promoted. The drawer special case is preserved. Also extract the repeated 300/650 literals and the open-modal selector into named constants in PopoverConstants.js.
Contributor
|
Please add either the |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Contributor
|
✔️ Deploy previews ready! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠️ Type Of Change
📖 Jira Ticket
https://dialpad.atlassian.net/browse/DLT-3601
📖 Description
calculateAnchorZindex()promoted a popover from the popover layer (--zi-popover, 300) to the modal-element layer (--zi-modal-element, 650) whenever a document-widequerySelectorfound any open modal:It now tests the popover's own anchor with
closest()instead, so only popovers that actually live inside an open modal are promoted. The existing drawer special case is preserved.Also extracts the repeated
300/650literals and the open-modal selector into named constants (POPOVER_Z_INDEX,POPOVER_MODAL_ELEMENT_Z_INDEX,OPEN_MODAL_SELECTOR) inPopoverConstants.js, and uses them at the twomodal ? 650 : …call sites.💡 Context
A document-wide search cannot distinguish a popover genuinely nested inside the open modal — which should outrank it — from unrelated global chrome that merely happens to be open at the same time. The result was that a global menu rendered bright and undimmed on top of the dimming overlay of a modal it had nothing to do with.
Worth noting for reviewers: this is a plain z-index bug, not a native
<dialog>top-layer bug. The modal in the reported case is opened withshow()(DtModal'smodal: falsedefault), so it never enters the browser top layer and nothing is inert — confirmed by the popover remaining clickable in that state.I verified the underlying platform behavior separately with a Playwright spike across Chromium 148, Firefox 150 and WebKit 26.4. Two results are relevant to how we approach this area going forward, though neither is addressed here:
showModal()inerts everything outside the dialog's subtree, including top-layer popovers. A popover shown aftershowModal()paints bright above the backdrop but is not focusable or clickable — so re-promotion cannot rescue an out-of-subtree overlay.modal: falsedefault there is no keyboard focus containment.Modal.vuehas onlyfocusFirstTabbablefor initial placement and fix(modal): NO-JIRA stop inerting the background when the dialog is not modal #1397 removed the background-inert machinery, so Tab escapes into dimmed, mouse-unreachable background content (reproduced in Chromium).Follow-ups, deliberately out of scope
📝 Checklist
For all PRs:
For all Vue changes:
New
Z-index Testsblock covers four cases: no modal open → 300; anchor inside an open modal → 650; unrelated modal open elsewhere → 300 (the regression guard); anchor inside a drawer → 650.DtDropdowninherits the fix throughDtPopover; no dropdown-level tests were added. No API change, so no Combinator/docs artifacts were regenerated.Full suite: 3271 passed, 2 skipped. Lint: 0 errors.