-
Notifications
You must be signed in to change notification settings - Fork 67
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
refactor: extract overlay auto add controller #7028
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
// Initialize auto-add behavior | ||
new OverlayAutoAddController<>(this, () -> true); | ||
|
||
addConfirmListener(event -> close()); |
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.
Are those listener added intentionally? Sounds like a breaking change that every confirm click automatically closes the dialog.
Example:
- user clicks confirm
- Application does some expensive task and failed
- Confirm dialog is closed even tho the task failed and user should try to click confirm again to execute the task again
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.
Currently all of those close the dialog already: https://github.com/vaadin/web-components/blob/e76c4576c2d1875e16681677bbf829637bf48e4f/packages/confirm-dialog/src/vaadin-confirm-dialog-mixin.js#L435-L451
But I was thinking about using a different approach as well, it seems better to stick with the opened-changed
event than make assumptions what individual actions would do.
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.
Oh thanks! Didn't know the web component does that already (I'm using my own confirm dialog based on the normal dialog API)
Interesting.. another thing to keep in mind when using the official confirm dialog.
No description provided.