Skip to content

Fix toast notification can not be closed #19510

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
}

#onCloseEnd(key: string) {
//move notification container out of modal container
var parentNode = this.parentNode;

Check failure on line 89 in src/Umbraco.Web.UI.Client/src/packages/core/components/backoffice-modal-container/backoffice-modal-container.element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
var uuiModalContainer = this.renderRoot.querySelector('uui-modal-container');

Check failure on line 90 in src/Umbraco.Web.UI.Client/src/packages/core/components/backoffice-modal-container/backoffice-modal-container.element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
var modalSidebar = uuiModalContainer?.querySelector('uui-modal-sidebar') as any;

Check failure on line 91 in src/Umbraco.Web.UI.Client/src/packages/core/components/backoffice-modal-container/backoffice-modal-container.element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
if(parentNode){
parentNode.insertBefore(modalSidebar.shadowRoot.querySelector('dialog').querySelector('umb-backoffice-notification-container'), this);
}

this._modalManager?.remove(key);
}

Expand All @@ -109,6 +117,32 @@
`;
}

async addNotificationContainer(){
const modalContainer = this.renderRoot.querySelector('uui-modal-container');
if(!modalContainer){
return;
}

await modalContainer.updateComplete;

var modalSidebar = modalContainer.querySelector('uui-modal-sidebar') as any;

Check failure on line 128 in src/Umbraco.Web.UI.Client/src/packages/core/components/backoffice-modal-container/backoffice-modal-container.element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
if (!modalSidebar) {
return;
}

var dialog = modalSidebar.shadowRoot?.querySelector('dialog');

Check failure on line 133 in src/Umbraco.Web.UI.Client/src/packages/core/components/backoffice-modal-container/backoffice-modal-container.element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
if(!dialog){
return
}

//move notification container into modal container
dialog.insertBefore((this.parentNode as HTMLElement).querySelector('umb-backoffice-notification-container'), dialog.firstChild);
}

override async updated(){
await Promise.all([this.updateComplete, this.addNotificationContainer()]);
}

static override styles: CSSResultGroup = [
UmbTextStyles,
css`
Expand Down
Loading