-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: fire closed event when Dialog overlay is closed #7471
Conversation
describe('closed event', () => { | ||
it('should dispatch closed event when closed', async () => { | ||
const closedSpy = sinon.spy(); | ||
listenOnce(dialog, 'closed', closedSpy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use addEventListener
instead of listenOnce
. When using listenOnce
, expect(closedSpy.calledOnce).to.be.true;
wouldn't fail even if the event was dispatched twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to remove the event listener at the end of the test. Each test run gets a fresh new dialog instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider also adding the event to typings tests.
Typing test added. |
@@ -102,6 +109,7 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap; | |||
* | |||
* @fires {CustomEvent} resize - Fired when the dialog resize is finished. | |||
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes. | |||
* @fires {CustomEvent} closed - Fired when the overlay is closed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is still different compared to .js
file: it says "overlay is closed" vs "dialog is closed".
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.5.0.beta2 and is also targeting the upcoming stable 24.5.0 version. |
Description
Add a new
closed
event that is triggered after the overlay is closedPart of #7422
Type of change