aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2016-12-08 11:04:58 +0200
committerHenri Sara <henri.sara@gmail.com>2016-12-08 11:04:58 +0200
commit474057c6a77dded2ffc6cc131c3053341c8959ee (patch)
tree8711a3a0474947e574f1056c168828fd6032c6fe
parent205efc49bf44c3d9150c970906bde7c152ecc2ff (diff)
downloadvaadin-framework-474057c6a77dded2ffc6cc131c3053341c8959ee.tar.gz
vaadin-framework-474057c6a77dded2ffc6cc131c3053341c8959ee.zip
Change default suggestion popup width in ComboBox (#91)
Closes vaadin/framework8-issues#522
-rw-r--r--server/src/main/java/com/vaadin/ui/ComboBox.java14
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java2
m---------tests/screenshots0
3 files changed, 11 insertions, 5 deletions
diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java
index 036d4bec1e..7e54e34b0b 100644
--- a/server/src/main/java/com/vaadin/ui/ComboBox.java
+++ b/server/src/main/java/com/vaadin/ui/ComboBox.java
@@ -347,7 +347,8 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
}
/**
- * Returns the suggestion pop-up's width as a CSS string.
+ * Returns the suggestion pop-up's width as a CSS string. By default this
+ * width is set to "100%".
*
* @see #setPopupWidth
* @since 7.7
@@ -393,13 +394,13 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
* Returns the empty selection caption.
* <p>
* The empty string {@code ""} is the default empty selection caption.
- *
+ *
* @see #setEmptySelectionAllowed(boolean)
* @see #isEmptySelectionAllowed()
* @see #setEmptySelectionCaption(String)
* @see #isSelected(Object)
* @see #select(Object)
- *
+ *
* @return the empty selection caption, not {@code null}
*/
public String getEmptySelectionCaption() {
@@ -430,6 +431,11 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
* Sets the suggestion pop-up's width as a CSS string. By using relative
* units (e.g. "50%") it's possible to set the popup's width relative to the
* ComboBox itself.
+ * <p>
+ * By default this width is set to "100%" so that the pop-up's width is
+ * equal to the width of the combobox. By setting width to null the pop-up's
+ * width will automatically expand beyond 100% relative width to fit the
+ * content of all displayed items.
*
* @see #getPopupWidth()
* @since 7.7
@@ -443,7 +449,7 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
/**
* Sets whether to scroll the selected item visible (directly open the page
* on which it is) when opening the combo box popup or not.
- *
+ * <p>
* This requires finding the index of the item, which can be expensive in
* many large lazy loading containers.
*
diff --git a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java
index 01a02a4a5f..a7be4865a7 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java
@@ -60,7 +60,7 @@ public class ComboBoxState extends AbstractSingleSelectState {
* itself.
*/
@DelegateToWidget
- public String suggestionPopupWidth = null;
+ public String suggestionPopupWidth = "100%";
/**
* True to allow the user to send new items to the server, false to only
diff --git a/tests/screenshots b/tests/screenshots
-Subproject 46b036dd9ac418341d489631090bc33ad310ba7
+Subproject 53c0f6fb288dbc91387fd8bb40038ff48bbd7a3