Skip to content

Commit

Permalink
fix: hide previous empty grid label if not null
Browse files Browse the repository at this point in the history
Close #103
  • Loading branch information
flang committed Jan 15, 2024
1 parent 2ebdc11 commit a061359
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.vaadin.flow.data.provider.Query;
import com.vaadin.flow.shared.Registration;
import java.io.Serializable;
import java.util.Optional;
import lombok.RequiredArgsConstructor;

@SuppressWarnings("serial")
Expand All @@ -48,6 +49,8 @@ class EmptyLabelGridHelper implements Serializable {
void setEmptyGridLabel(Component component) {
Grid<?> grid = helper.getGrid();

Optional.ofNullable(emptyLabel).ifPresent(l -> l.setVisible(false));

emptyLabel = component;

if (registration != null) {
Expand Down

0 comments on commit a061359

Please sign in to comment.