Skip to content

Components set as headers for a ConfirmDialog are not interactable #5277

Closed
vaadin/web-components
#6357

Description

@ugur-vaadin

Description

When a component like a button is set as header to ConfirmDialog, it cannot be interacted (cannot be clicked in this case).

Likely related to another issue regarding removing content from a ConfirmDialog.

Expected outcome

I would expect the components to be interactable.

Minimal reproducible example

ConfirmDialog dialog = new ConfirmDialog();
dialog.setHeader(new NativeButton("Click to close", click -> reference.get().close()));
dialog.open();

Steps to reproduce

  1. Add the snippet above to a view
  2. Click the close button
  3. Observe that the button is not clickable and the dialog is not closed

Environment

Vaadin version(s): 24.2
OS: MacOS

Browsers

Issue is not browser related

Activity

  1. self-assigned this
    on Aug 15, 2023
  2. web-padawan commented on Aug 15, 2023

    @web-padawan
    Member

    Reproduced also with the web component using the following code:

    <vaadin-button id="open">Open</vaadin-button>
    
    <vaadin-confirm-dialog>
      <button slot="header">Close</button>
      Do you want to save or discard the changes?
    </vaadin-confirm-dialog>
    
    <script type="module">
      import '@vaadin/confirm-dialog';
    
      const dialog = document.querySelector('vaadin-confirm-dialog');
      const button = document.querySelector('#open');
    
      dialog._headerNode.addEventListener('click', () => {
        dialog.opened = false;
      });
    
      button.addEventListener('click', (event) => {
        dialog.opened = true;
      });
    </script>
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