Skip to content
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

[ConfirmDialog] setCancelButton should set cancelable consistently #7024

Open
sissbruecker opened this issue Jan 10, 2025 · 1 comment
Open
Labels
refactor Internal improvement requires new major This would be a breaking change vaadin-confirm-dialog

Comments

@sissbruecker
Copy link
Contributor

sissbruecker commented Jan 10, 2025

Describe your motivation

When you set a custom cancel button, some overloads make the dialog cancelable automatically, while others do not:

  • setCancelButton(String buttonText, ComponentEventListener<CancelEvent> cancelListener) - Cancelable
  • setCancelButton(String buttonText, ComponentEventListener<CancelEvent> cancelListener, String theme) - Cancelable
  • setCancelButton(Component component) - Not cancelable
  • setCancelButton(Element element) - Not cancelable

Describe the solution you'd like

The behavior should be consistent, so either all methods make the dialog cancelable, or neither of them does. Same goes for setRejectButton.

Describe alternatives you've considered

No response

Additional context

No response

@yuriy-fix
Copy link
Contributor

Methods shouldn’t change the cancelable state. If it’s false before setting, it should stay false, and if it’s true, it should remain true. Reject button should be changed accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Internal improvement requires new major This would be a breaking change vaadin-confirm-dialog
Projects
None yet
Development

No branches or pull requests

2 participants