-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setValue
doesn't trigger validation for some TB field elements
#3420
Comments
setValue
method of Field TestBench elements doesn't trigger validationsetValue
method of Field TB elements doesn't trigger validation
I wonder if it might be more suitable to have a separate method It is currently confusing that This ticket is probably a good time to decide whether we want to align that or keep these methods working the old way. Lines 130 to 140 in 39b52fd
Lines 154 to 163 in 39b52fd
UPD: If we trigger |
We would probably want to modify |
The alternative way could be to ensure every field component provides a It should be said though that using public void sendKeys(CharSequence... keysToSend) {
$("input").first().sendKeys(keysToSend);
}
public void sendKeysClearAll() {
sendKeys(Keys.SHIFT, Keys.HOME, Keys.BACK_SPACE);
// or
// sendKeys(Keys.META, "A", Keys.BACK_SPACE);
} |
The Example: an input has a |
On closer inspection, it turns out that setValue in its default implementation is actually useless at least for components in the So, it seems that the only reasonable option that remains would be to fix setValue to make it set |
setValue
method of Field TB elements doesn't trigger validationsetValue
doesn't trigger validation for some TB field elements
Description
Currently, Field TestBench elements trigger
blur
andchange
on the component's host rather than the input when setting a value withsetValue()
, which results in validation not running.flow-components/vaadin-text-field-flow-parent/vaadin-text-field-testbench/src/main/java/com/vaadin/flow/component/textfield/testbench/TextFieldElement.java
Lines 35 to 40 in 39b52fd
This is apparently an omission from the a11y slotted refactoring.
Affected components
Expected outcome
setValue()
of Field TextBench elements should triggerblur
andchange
on the input rather than the host after a new value is set.Note, if
change
andblur
are triggered on the input, thensetValue()
should also trigger aninput
event before thechange
event as otherwise the input's value won't be synced with the field'svalue
property.Environment
Vaadin version(s): 21, 22, 23
OS: Mac OS
Browsers
No response
The text was updated successfully, but these errors were encountered: