Repository navigation
fix(Modal): destroying or closing one modal leaves the others alone - #325
Merged
Merged
Conversation
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.
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.
Destroying a closed
<c-modal>(e.g. in a list row) closed a modal opened elsewhere:ngOnDestroysendstoggle({ show: false, modal: this })and every other visible modal closed on any action aimed at another one. Two modals withoutidalso matched each other (undefined === undefined).Other modals now close only when one actually opens through
ModalService(newopened$, emitted once the modal is visible; focus candidates handed over as before). An action without a target closes all visible modals,show: trueincluded (it used to open every modal withoutid). A modal withoutidgets a generatedidproperty, 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.