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

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

Open
web-padawan opened this issue Dec 18, 2024 · 0 comments

Comments

@web-padawan
Copy link
Member

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

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

No branches or pull requests

2 participants