瀏覽代碼

Properly lock the width of the combo box text field (#8313)

tags/7.0.0.alpha2
Leif Åstrand 12 年之前
父節點
當前提交
f1989ba456
共有 1 個檔案被更改,包括 10 行新增3 行删除
  1. 10
    3
      src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java

+ 10
- 3
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java 查看文件

@@ -1576,6 +1576,15 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
&& suggestionPopupMinWidth > w) {
setWidth(suggestionPopupMinWidth + "px");
}

/*
* Lock the textbox width to its current value if it's not already
* locked
*/
if (!tb.getElement().getStyle().getWidth().endsWith("px")) {
tb.setWidth((tb.getOffsetWidth() - selectedItemIcon
.getOffsetWidth()) + "px");
}
}
}

@@ -1592,9 +1601,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
@Override
public void setWidth(String width) {
super.setWidth(width);
if (width.length() == 0) {
tb.setWidth("");
} else {
if (width.length() != 0) {
tb.setWidth("100%");
}
}

Loading…
取消
儲存