Browse Source

Change default suggestion popup width in ComboBox (#91)

Closes vaadin/framework8-issues#522
tags/8.0.0.alpha9
Aleksi Hietanen 7 years ago
parent
commit
474057c6a7

+ 10
- 4
server/src/main/java/com/vaadin/ui/ComboBox.java View File

} }


/** /**
* 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 * @see #setPopupWidth
* @since 7.7 * @since 7.7
* Returns the empty selection caption. * Returns the empty selection caption.
* <p> * <p>
* The empty string {@code ""} is the default empty selection caption. * The empty string {@code ""} is the default empty selection caption.
*
*
* @see #setEmptySelectionAllowed(boolean) * @see #setEmptySelectionAllowed(boolean)
* @see #isEmptySelectionAllowed() * @see #isEmptySelectionAllowed()
* @see #setEmptySelectionCaption(String) * @see #setEmptySelectionCaption(String)
* @see #isSelected(Object) * @see #isSelected(Object)
* @see #select(Object) * @see #select(Object)
*
*
* @return the empty selection caption, not {@code null} * @return the empty selection caption, not {@code null}
*/ */
public String getEmptySelectionCaption() { public String getEmptySelectionCaption() {
* Sets the suggestion pop-up's width as a CSS string. By using relative * 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 * units (e.g. "50%") it's possible to set the popup's width relative to the
* ComboBox itself. * 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() * @see #getPopupWidth()
* @since 7.7 * @since 7.7
/** /**
* Sets whether to scroll the selected item visible (directly open the page * Sets whether to scroll the selected item visible (directly open the page
* on which it is) when opening the combo box popup or not. * 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 * This requires finding the index of the item, which can be expensive in
* many large lazy loading containers. * many large lazy loading containers.
* *

+ 1
- 1
shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java View File

* itself. * itself.
*/ */
@DelegateToWidget @DelegateToWidget
public String suggestionPopupWidth = null;
public String suggestionPopupWidth = "100%";


/** /**
* True to allow the user to send new items to the server, false to only * True to allow the user to send new items to the server, false to only

+ 1
- 1
tests/screenshots

Subproject commit 46b036dd9ac418341d489631090bc33ad310ba72
Subproject commit 53c0f6fb288dbc91387fd8bb40038ff48bbd7a32

Loading…
Cancel
Save