-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix: do not invalidate when clearing a valid value #5579
Conversation
7409383
to
a828ba7
Compare
|
||
// When the value is cleared programmatically, reset hasInputValue | ||
// so that the following validation doesn't treat this as bad input. | ||
if (Objects.equals(value, getEmptyValue())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Even though the issue doesn't manifest in DatePicker because its web component handles hasInputValue differently from other components, I've decided that it won't hurt to include the fix in DatePicker as well in case the web component's implementation changes in the future.
4375ff3
to
8454b18
Compare
c2a4548
to
d488f2b
Compare
d488f2b
to
84d906a
Compare
|
||
// When the value is cleared programmatically, reset hasInputValue | ||
// so that the following validation doesn't treat this as bad input. | ||
if (valueEquals(value, getEmptyValue())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this "intensive calculation" is done twice for the same params :) (all setValue methods)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, extracted into a var.
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
This ticket/PR has been released with Vaadin 24.3.0.alpha1 and is also targeting the upcoming stable 24.3.0 version. |
Description
The PR prevents field components that support bad input from invalidating when clearing a valid value programmatically.
Depends on
Fixes #5462
Part of #5537
Type of change