Skip to content

fix(Modal): destroying or closing one modal leaves the others alone - #325

Merged
xidedix merged 1 commit into
v5.7from
fix/modal-destroy-keeps-other-open
Oct 22, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/modal-destroy-keeps-other-open

Conversation

@xidedix

@xidedix xidedix commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Destroying a closed <c-modal> (e.g. in a list row) closed a modal opened elsewhere: ngOnDestroy sends toggle({ show: false, modal: this }) and every other visible modal closed on any action aimed at another one. Two modals without id also matched each other (undefined === undefined).

Other modals now close only when one actually opens through ModalService (new opened$, emitted once the modal is visible; focus candidates handed over as before). An action without a target closes all visible modals, show: true included (it used to open every modal without id). A modal without id gets a generated id property, not rendered, so [cModalToggle]="m.id" reaches only that modal. An action aimed at a modal that does not exist no longer closes the open one.

ngOnDestroy sends toggle({ show: false, modal: this }) and every other visible modal closed on it; two modals without id also matched each other (undefined === undefined). Other modals now close only when one actually opens through ModalService (separate opened$, emitted once visible; focus candidates handed over as before). An action without a target closes all visible modals, show: true included (it used to open every modal without id). A modal without id gets a generated id property (not rendered), so [cModalToggle]="m.id" reaches only that modal. An action aimed at a modal that does not exist no longer closes the open one.
@xidedix
xidedix merged commit f1d0937 into v5.7 Oct 22, 2026
9 checks passed
@xidedix
xidedix deleted the fix/modal-destroy-keeps-other-open branch October 22, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant