diff --git a/bower.json b/bower.json index 8b8932098..dff4a77c9 100644 --- a/bower.json +++ b/bower.json @@ -38,7 +38,7 @@ "polymer": "^2.0.0", "vaadin-control-state-mixin": "vaadin/vaadin-control-state-mixin#^2.1.1", "vaadin-overlay": "vaadin/vaadin-overlay#^3.2.0", - "vaadin-text-field": "vaadin/vaadin-text-field#^2.1.1", + "vaadin-text-field": "vaadin/vaadin-text-field#^2.3.0", "vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.3.2", "vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.1.1", "vaadin-material-styles": "vaadin/vaadin-material-styles#^1.1.2", diff --git a/demo/combo-box-basic-demos.html b/demo/combo-box-basic-demos.html index 7b3d57200..0c7897e98 100644 --- a/demo/combo-box-basic-demos.html +++ b/demo/combo-box-basic-demos.html @@ -40,6 +40,23 @@

Configuring the Combo Box

+

Clear Button

+ +

Use the clear-button-visible attribute to display the clear button of an individual combobox.

+ + + + +

Allow Custom Values

Allow the user to set any value for the field in addition to selecting a value from the dropdown menu.

diff --git a/src/vaadin-combo-box-light.html b/src/vaadin-combo-box-light.html index ebccdb8f4..d3efc49dd 100644 --- a/src/vaadin-combo-box-light.html +++ b/src/vaadin-combo-box-light.html @@ -5,6 +5,7 @@ --> + @@ -13,6 +14,11 @@ + + + + diff --git a/test/visual/clear-button.html b/test/visual/clear-button.html new file mode 100644 index 000000000..7aba05d4d --- /dev/null +++ b/test/visual/clear-button.html @@ -0,0 +1,29 @@ + + + + + + + + + + + +
+ No value + + +
Basic value + + +
Disabled + + +
Read-only + +
+ + diff --git a/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/chrome.png b/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/chrome.png new file mode 100644 index 000000000..dfcb2a96f Binary files /dev/null and b/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/chrome.png differ diff --git a/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/firefox.png b/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/firefox.png new file mode 100644 index 000000000..ef0a8b4e0 Binary files /dev/null and b/test/visual/screens/vaadin-combo-box/clear-button-tests-lumo/default/firefox.png differ diff --git a/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/chrome.png b/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/chrome.png new file mode 100644 index 000000000..df4fcf93c Binary files /dev/null and b/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/chrome.png differ diff --git a/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/firefox.png b/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/firefox.png new file mode 100644 index 000000000..160896956 Binary files /dev/null and b/test/visual/screens/vaadin-combo-box/clear-button-tests-material/default/firefox.png differ diff --git a/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/chrome.png b/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/chrome.png index f57fc6c5d..70cc8613d 100644 Binary files a/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/chrome.png and b/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/chrome.png differ diff --git a/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/firefox.png b/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/firefox.png index c1560f39e..ff9daa8c8 100644 Binary files a/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/firefox.png and b/test/visual/screens/vaadin-combo-box/default-tests-lumo/default/firefox.png differ diff --git a/test/visual/screens/vaadin-combo-box/default-tests-material/default/chrome.png b/test/visual/screens/vaadin-combo-box/default-tests-material/default/chrome.png index 447ecbda7..f5ff5b64d 100644 Binary files a/test/visual/screens/vaadin-combo-box/default-tests-material/default/chrome.png and b/test/visual/screens/vaadin-combo-box/default-tests-material/default/chrome.png differ diff --git a/test/visual/screens/vaadin-combo-box/default-tests-material/default/firefox.png b/test/visual/screens/vaadin-combo-box/default-tests-material/default/firefox.png index 8ae0f5920..708898d0a 100644 Binary files a/test/visual/screens/vaadin-combo-box/default-tests-material/default/firefox.png and b/test/visual/screens/vaadin-combo-box/default-tests-material/default/firefox.png differ diff --git a/test/visual/test.js b/test/visual/test.js index ecd60d252..1a22189dd 100644 --- a/test/visual/test.js +++ b/test/visual/test.js @@ -22,6 +22,13 @@ gemini.suite('vaadin-combo-box', function(rootSuite) { .capture('default'); }); + gemini.suite(`clear-button-tests-${theme}`, function(suite) { + suite + .setUrl(`clear-button.html?theme=${theme}`) + .setCaptureElements('#clear-button-tests') + .capture('default'); + }); + gemini.suite(`icons-${theme}`, function(suite) { suite .setUrl(`icons.html?theme=${theme}`) diff --git a/theme/lumo/vaadin-combo-box-styles.html b/theme/lumo/vaadin-combo-box-styles.html index 81a826be4..919ace940 100644 --- a/theme/lumo/vaadin-combo-box-styles.html +++ b/theme/lumo/vaadin-combo-box-styles.html @@ -13,10 +13,6 @@ [part="toggle-button"]::before { content: var(--lumo-icons-dropdown); } - - [part="clear-button"]::before { - content: var(--lumo-icons-cross); - }
diff --git a/theme/material/vaadin-combo-box-styles.html b/theme/material/vaadin-combo-box-styles.html index f6d336ee6..db371f404 100644 --- a/theme/material/vaadin-combo-box-styles.html +++ b/theme/material/vaadin-combo-box-styles.html @@ -20,10 +20,6 @@ :host([opened]) [part="toggle-button"] { transform: rotate(180deg); } - - [part="clear-button"]::before { - content: var(--material-icons-clear); - }