-
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
fix: disabled items can now be part of a CheckboxGroup's valid value #1903
Conversation
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.
Preliminary review.
I have some trouble understanding what the previous validation logic was about, and therefore am not sure about it's complete removal. I'm wondering if there is anything left that should still be validated (can't think of anything though)?. Need to clarify that.
However I would suggest to add regression ITs for the scenarios that were discussed in the issue:
set item enabled provider to disable checkboxes, verify that a disabled checkbox can be changed programmatically✅Donepreselect value in a checkbox, set item enabled provider to disable some checkboxes, verify that non-disabled checkboxes can still be changed manually / from the browser✅Done
Added regression tests |
Some changes were requested in pair review
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.
LGTM
SonarQube analysis reported 13 issues Top 10 issues
|
…1903) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
…1903) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
…1903) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
…1903) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
…esn't change (#1903) (#1968) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com> Co-authored-by: David Sosa <76832183+sosa-vaadin@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
…esn't change (#1903) (#1970) Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com> Co-authored-by: David Sosa <76832183+sosa-vaadin@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com> Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
This ticket/PR has been released with platform 22.0.0.alpha1 and is also targeting the upcoming stable 22.0.0 version. |
Description
EDIT: the "valid" logic was replaced for one where the values of disabled items are checked to see if they changed. If they did, then it's an invalid change and will be rolled back.
The value of a CheckboxGroup is a Set of all selected (checked) items. Items in a CheckboxGroup can have their enabled state managed with an ItemEnabledProvider. This ItemEnabledProvider is also used to check whether the value itself of the CheckboxGroup is valid. If any selected (checked) item is disabled (when checked against the ItemEnabledProvider), then the CheckboxGroup is said to have an invalid value. This check happens every time the value changes.
If the new value is invalid, it immediately rolls back to its previous value. This explains the problems encountered in the issue this PR is trying to fix. By removing this "valid" value logic, any item, whether enabled or disabled, will not invalid the CheckboxGroup's value. The user will still be unable to select (by clicking or focusing) a disabled checkbox item, but its selection can still be set programmatically. Any combination of selected items should be a valid value for the group, regardless of those items being enabled or disabled.
Fixes #1185
Type of change
Checklist