|
|
@@ -428,10 +428,15 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, |
|
|
|
// Add TT anchor point |
|
|
|
getElement().setId("VAADIN_COMBOBOX_OPTIONLIST"); |
|
|
|
|
|
|
|
leftPosition = getDesiredLeftPosition(); |
|
|
|
topPosition = getDesiredTopPosition(); |
|
|
|
// Set the default position if the popup isn't already visible, |
|
|
|
// the setPopupPositionAndShow call later on can deal with any |
|
|
|
// adjustments that might be needed |
|
|
|
if (!popup.isShowing()) { |
|
|
|
leftPosition = getDesiredLeftPosition(); |
|
|
|
topPosition = getDesiredTopPosition(); |
|
|
|
|
|
|
|
setPopupPosition(leftPosition, topPosition); |
|
|
|
setPopupPosition(leftPosition, topPosition); |
|
|
|
} |
|
|
|
|
|
|
|
int nullOffset = getNullSelectionItemShouldBeVisible() ? 1 : 0; |
|
|
|
boolean firstPage = currentPage == 0; |
|
|
@@ -894,16 +899,24 @@ public class VComboBox extends Composite implements Field, KeyDownHandler, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (offsetWidth + menuMarginBorderPaddingWidth |
|
|
|
+ left < VComboBox.this.getAbsoluteLeft() |
|
|
|
+ VComboBox.this.getOffsetWidth()) { |
|
|
|
// Popup doesn't reach all the way to the end of the input |
|
|
|
// field, filtering may have changed the popup width. |
|
|
|
left = VComboBox.this.getAbsoluteLeft(); |
|
|
|
} |
|
|
|
if (offsetWidth + menuMarginBorderPaddingWidth + left > Window |
|
|
|
.getClientWidth()) { |
|
|
|
// Popup doesn't fit the view, needs to be opened to the left |
|
|
|
// instead. |
|
|
|
left = VComboBox.this.getAbsoluteLeft() |
|
|
|
+ VComboBox.this.getOffsetWidth() - offsetWidth |
|
|
|
- (int) menuMarginBorderPaddingWidth; |
|
|
|
if (left < 0) { |
|
|
|
left = 0; |
|
|
|
menu.setWidth(Window.getClientWidth() + "px"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (left < 0) { |
|
|
|
left = 0; |
|
|
|
menu.setWidth(Window.getClientWidth() + "px"); |
|
|
|
} |
|
|
|
|
|
|
|
setPopupPosition(left, top); |