Skip to content

[crud] The hidden attribute set on the custom delete button is overridden #8364

@web-padawan

Description

@web-padawan

Description

When using custom "delete" button and setting hidden attribute on it, the vaadin-crud removes it due to this logic:

deleteButton.toggleAttribute('hidden', isNew);

Expected outcome

Expected the "Delete" button to be always hidden when the attribute is set.

Minimal reproducible example

<vaadin-crud>
  <vaadin-button slot="delete-button" hidden>Deleting forbidden</vaadin-button>
</vaadin-crud>

<script type="module">
  import '@vaadin/crud';

  const crud = document.querySelector('vaadin-crud');
  crud.items = [
    {
      firstName: 'John',
      lastName: 'Doe',
    },
    {
      firstName: 'Jane',
      lastName: 'Doe',
    },
  ];
</script>

Steps to reproduce

  1. Add the snippet above to the page
  2. Open the editor
  3. Note the delete button is still visible

Environment

Vaadin version(s): 24.x

Browsers

Issue is not browser related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions