Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[crud] Calling setVisible(false) on Delete, Cancel or Confirm button breaks teleporting #6965

Closed
web-padawan opened this issue Dec 18, 2024 · 0 comments · Fixed by vaadin/web-components#8372

Comments

@web-padawan
Copy link
Member

web-padawan commented Dec 18, 2024

Description

When calling setVisible(false) on e.g. "Delete" button of the CRUD, the teleporting logic doesn't work because:

  • The vaadin-button doesn't have slot attribute on the client side due to setVisible(false) (as that prevents Flow from sending updates to the client by design),
  • The _deleteButton property on the web component is empty as it's set based on the slotted node presence,
  • The corresponding check fails and there are no elements teleported at all (notably, there is no error / warning shown either).

Expected outcome

Expected all the elements but the missing button to be teleported as usual.

This could be probably done by changing the web component to not check for any of the buttons if _noDefaultButtons flag added in vaadin/web-components#7181 is used (which was specifically added for Flow counterpart).

Minimal reproducible example

crud.getDeleteButton().setVisible(false);

Steps to reproduce

  1. Add the line above after adding a CRUD to the view.
  2. Make sure the default (dialog) editor position is used.
  3. Press "New" button to open a dialog - it will be empty

Environment

Vaadin version(s): 24.x

Browsers

Issue is not browser related

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

Successfully merging a pull request may close this issue.

1 participant