Skip to content

Commit

Permalink
fix: do not remove emptyLabel component from parent
Browse files Browse the repository at this point in the history
  • Loading branch information
flang authored and javier-godoy committed Dec 7, 2023
1 parent bdd4871 commit 2972aab
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,14 @@ class EmptyLabelGridHelper implements Serializable {
void setEmptyGridLabel(Component component) {
Grid<?> grid = helper.getGrid();

if (emptyLabel != null) {
emptyLabel.getElement().removeFromParent();
emptyLabel = null;
}
emptyLabel = component;

if (registration != null) {
registration.remove();
registration = null;
}

if (component != null) {
emptyLabel = component;

DataProviderListener listener =
ev -> component.setVisible(grid.getDataProvider().size(new Query<>()) == 0);
registration = grid.getDataProvider().addDataProviderListener(listener);
Expand Down

0 comments on commit 2972aab

Please sign in to comment.