diff options
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java index 81fa6b9ab9..86b88a40b7 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java @@ -104,6 +104,7 @@ public class IFilterSelect extends Composite implements Paintable, Field, private boolean isPagingEnabled = true; private long lastAutoClosed; + private int menuLeftMargin = -1; SuggestionPopup() { super(true, false, true); @@ -303,6 +304,24 @@ public class IFilterSelect extends Composite implements Paintable, Field, naturalMenuWidth = desiredWidth; } + if (BrowserInfo.get().isIE()) { + // Take left margin into account + if (menuLeftMargin == -1) { + int menuOffsetLeft = menu.getElement().getOffsetLeft(); + int menuParentOffsetLeft = getContainerElement() + .getOffsetLeft(); + menuLeftMargin = menuOffsetLeft - menuParentOffsetLeft; + } + + /* + * IE requires us to specify the width for the container + * element. Otherwise it will be 100% wide + */ + int rootWidth = naturalMenuWidth + menuLeftMargin; + DOM.setStyleAttribute(getContainerElement(), "width", rootWidth + + "px"); + } + if (offsetHeight + getPopupTop() > Window.getClientHeight() + Window.getScrollTop()) { // popup on top of input instead |