Skip to content

NzMessageService does not clean up after message disappears #7772

Closed
@swseverance

Description

@swseverance

Reproduction link

https://codesandbox.io/s/2rxitg

Steps to reproduce

  1. Trigger a message to appear by using NzMessageService.success(content, [options])
  2. After the message disappears observe that the contents of the overlay container are not empty:
    <div class="cdk-overlay-container">
      <div class="cdk-global-overlay-wrapper" dir="ltr">
        <div id="cdk-overlay-0" class="cdk-overlay-pane" style="z-index: 1010; position: static">
          <nz-message-container>
             <div class="ant-message" style="top: 24px">
              <!---->
            </div></nz-message-container>
        </div>
      </div>
    </div>
  1. Other ng-zorro components that use the overlay container appear to clean it up after they are removed so that the DOM looks like:
 <div class="cdk-overlay-container"></div>

What is expected?

I would expect unnecessary elements to be removed from the overlay container after the nz message is displayed

What is actually happening?

Unnecessary elements remain

Environment Info
ng-zorro-antd 14.3.0
Browser All

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions