Skip to content

[confirm-dialog] Setting custom buttons keeps adding them instead of replacing them #2710

Closed

Description

@sissbruecker

Description

Calling a method such as setConfirmButton multiple times will keep adding the elements to the slot, instead of replacing them. Only the first call for setting the custom button replaces the default button, after that the Flow component keeps adding content to the slot without removing previous custom content. This problem applies to all button slots (confirm, cancel, reject).

Possible workaround: Keep track of and manually remove previously added buttons.

Expected outcome

Calling a method such as setConfirmButton multiple times results in one button in that slot.

Actual outcome

Calling a method such as setConfirmButton multiple times results in multiple button in that slot.

Minimal reproducible example

        ConfirmDialog dialog = new ConfirmDialog();
        dialog.setConfirmButton(new Button("Publish Document A"));
        dialog.setConfirmButton(new Button("Publish Document B"));

Steps to reproduce

  1. Run the example above
  2. Notice how there are now two confirm buttons

Environment

  • v23

Browsers Affected

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions