diff options
Diffstat (limited to 'testbench-api')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java index e000b0bddd..23b9a98502 100644 --- a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java +++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java @@ -52,8 +52,8 @@ public class ComboBoxElement extends AbstractSingleSelectElement { selectByTextFromPopup(text); return; } - getInputField().clear(); - getInputField().sendKeys(text); + clear(); + sendKeys(text); selectSuggestion(text); } @@ -231,6 +231,11 @@ public class ComboBoxElement extends AbstractSingleSelectElement { @Override public void clear() { getInputField().clear(); + String value = getText(); + if (value != null && !value.isEmpty()) { + ((JavascriptExecutor) getDriver()) + .executeScript("arguments[0].value = ''", getInputField()); + } } @Override |