Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module:message): clean up DOM after usage #7965

Merged
merged 1 commit into from Sep 18, 2023

Conversation

swseverance
Copy link
Contributor

@swseverance swseverance commented May 29, 2023

Call overlayRef.dispose() when all instances of messages have disappeared

Resolves #7772

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

The current implementation of the message service leaves a nz-message-container element in the DOM even after all messages have been removed. This PR introduces a small change so that the DOM is cleaned up when all messages are removed, so no extra elements remain in the DOM

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #7772

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

@zorro-bot
Copy link

zorro-bot bot commented May 29, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #7965 (0c03c20) into master (544f308) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 0c03c20 differs from pull request most recent head 553f02d. Consider uploading reports for the commit 553f02d to get more accurate results

@@            Coverage Diff             @@
##           master    #7965      +/-   ##
==========================================
- Coverage   91.64%   91.63%   -0.02%     
==========================================
  Files         515      515              
  Lines       17637    17652      +15     
  Branches     2789     2791       +2     
==========================================
+ Hits        16164    16175      +11     
- Misses       1175     1179       +4     
  Partials      298      298              
Impacted Files Coverage Δ
components/core/services/singleton.ts 88.23% <100.00%> (+2.52%) ⬆️
components/message/base.ts 97.01% <100.00%> (+3.57%) ⬆️

... and 3 files with indirect coverage changes

@swseverance
Copy link
Contributor Author

Hi @Laffery do you mind taking a look at my PR? Thanks

@swseverance
Copy link
Contributor Author

@simplejason do you mind taking a look? Thank you

@simplejason
Copy link
Member

@simplejason do you mind taking a look? Thank you

Thanks for your contributions, it looks good for me, please rebase your brach with the master branch, after that I will merge it :) @Nicoss54 It would be great to hear your thoughts if you have the time!

@Nicoss54
Copy link
Collaborator

@simplejason do you mind taking a look? Thank you

Thanks for your contributions, it looks good for me, please rebase your brach with the master branch, after that I will merge it :) @Nicoss54 It would be great to hear your thoughts if you have the time!

@simplejason i take the point ;)

Call `overlayRef.dispose()` when all instances of messages have
disappeared

Resolves NG-ZORRO#7772
@simplejason simplejason merged commit 71ead99 into NG-ZORRO:master Sep 18, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NzMessageService does not clean up after message disappears
3 participants