Skip to content

Commit

Permalink
fix: fix button position when orientation changes
Browse files Browse the repository at this point in the history
Close #154
  • Loading branch information
javier-godoy authored and paodb committed Sep 18, 2023
1 parent 38e8f1e commit a98aea7
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private VerticalLayout createVerticalContainer(boolean reverse) {

private VerticalLayout getVerticalButtonContainer() {
fakeButtonContainerLabel.getElement().setProperty("innerHTML", " ");
fakeButtonContainerLabel.setVisible(false);
updateFakeButtonContainerVisiblity();

VerticalLayout vButtonContainer =
new VerticalLayout(
Expand All @@ -429,6 +429,11 @@ private VerticalLayout getVerticalButtonContainer() {
return vButtonContainer;
}

private void updateFakeButtonContainerVisiblity() {
fakeButtonContainerLabel
.setVisible(available.columnLabel.isVisible() || selection.columnLabel.isVisible());
}

private HorizontalLayout getHorizontalButtonContainer() {
HorizontalLayout hButtonContainer =
new HorizontalLayout(
Expand Down Expand Up @@ -570,7 +575,7 @@ public TwinColGrid(final Collection<T> options, final String caption) {
public TwinColGrid<T> withAvailableGridCaption(final String caption) {
available.columnLabel.setText(caption);
available.columnLabel.setVisible(true);
fakeButtonContainerLabel.setVisible(true);
updateFakeButtonContainerVisiblity();
return this;
}

Expand All @@ -583,7 +588,7 @@ public TwinColGrid<T> withAvailableGridCaption(final String caption) {
public TwinColGrid<T> withSelectionGridCaption(final String caption) {
selection.columnLabel.setText(caption);
selection.columnLabel.setVisible(true);
fakeButtonContainerLabel.setVisible(true);
updateFakeButtonContainerVisiblity();
return this;
}

Expand Down

0 comments on commit a98aea7

Please sign in to comment.