Skip to content

Commit ae850ef

Browse files
committed
Add OPENED event to uui-toast-notification-element
1 parent 6294014 commit ae850ef

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
2+
23
import { UUIToastNotificationElement } from './uui-toast-notification.element';
34

45
export class UUIToastNotificationEvent extends UUIEvent<
56
{},
67
UUIToastNotificationElement
78
> {
89
public static readonly OPENING = 'opening';
10+
public static readonly OPENED = 'opened';
911
public static readonly CLOSING = 'closing';
1012
public static readonly CLOSED = 'closed';
1113
}

packages/uui-toast-notification/lib/uui-toast-notification.element.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { UUIToastNotificationEvent } from './UUIToastNotificationEvent';
1313
/**
1414
* @element uui-toast-notification
1515
* @fires {UUIToastNotificationEvent} opening - fires when the toast is starting to open
16+
* @fires {UUIToastNotificationEvent} opened - fires when the toast is open after the open-animation
1617
* @fires {UUIToastNotificationEvent} closing - fires when the toast is starting to close
1718
* @fires {UUIToastNotificationEvent} closed - fires when the toast is closed
1819
* @description - Component for displaying a toast notification, preferably used in toast-notification-container.
@@ -257,6 +258,10 @@ export class UUIToastNotificationElement extends LitElement {
257258
if (this._pauseTimer === false) {
258259
this._timer?.start();
259260
}
261+
262+
this.dispatchEvent(
263+
new UUIToastNotificationEvent(UUIToastNotificationEvent.OPENED)
264+
);
260265
}
261266
}, 480);
262267
});

0 commit comments

Comments
 (0)