Skip to content

Commit

Permalink
Wrap selects in TwinColSelect to workaround Chrome 76 layout bug
Browse files Browse the repository at this point in the history
Addresses #11712
  • Loading branch information
TatuLund authored Sep 9, 2019
1 parent 1e36e30 commit f0e5cde
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/src/main/java/com/vaadin/client/ui/VTwinColSelect.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,22 @@ public VTwinColSelect() {
// extra empty space
captionWrapper.setVisible(false);

panel.add(optionsListBox);
// Wrap select in Div to workaround bug in Chrome 76, see #11712
HTML optionsWrapper = new HTML("<div></div>");
optionsWrapper.getElement().appendChild(optionsListBox.getElement());
optionsWrapper.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
panel.add(optionsWrapper);
buttons.add(addItemsLeftToRightButton);
final HTML br = new HTML("<span/>");
br.setStyleName(CLASSNAME + "-deco");
buttons.add(br);
buttons.add(removeItemsRightToLeftButton);
panel.add(buttons);
panel.add(selectionsListBox);
// Wrap select in Div to workaround bug in Chrome 76, see #11712
HTML selectionsWrapper = new HTML("<div></div>");
selectionsWrapper.getElement().appendChild(selectionsListBox.getElement());
selectionsWrapper.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
panel.add(selectionsWrapper);

optionsListBox.addKeyDownHandler(this);
optionsListBox.addMouseDownHandler(this);
Expand Down

0 comments on commit f0e5cde

Please sign in to comment.