-
Notifications
You must be signed in to change notification settings - Fork 164
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
Revert "fix: make property change listener trigger on removeProperty (#19196)" #19310
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vursen
approved these changes
May 6, 2024
Quality Gate passedIssues Measures |
Test Results1 101 files ± 0 1 101 suites ±0 1h 27m 35s ⏱️ + 4m 45s Results for commit 04de150. ± Comparison against base commit 4769d87. This pull request removes 9 tests.
|
1 task
vaadin-bot
pushed a commit
that referenced
this pull request
May 6, 2024
…19196)" (#19310) This reverts commit 63e6dfd. The original fix for the property change event is correct per se, but, unfortunately, we faced an odd side effect in the RadioButtonGroup component that blocks our development process and would be a breaking change for RadioButtonGroup's users. Here are some details: The getValue() method of the RadioButtonGroup (and probably other similar components, like Select and CheckboxGroup) returned an item that was set in setValue() before, even if it was an invalid item, e.g. it's key/id wasn't in the list of items for this component. With this change, the PropertyChangeEvent is triggered, that causes handlePropertyChange and hasValidValue method to be called. hasValidValue doesn't properly check if the item is in the list of items on the server and returns true, that causes a state change in setModelValue, that eventually resets the value to null. In other words, if one wants to set a new value, which isn't present in the item's list, the component set the value to null, which sounds like even a bigger bug. The proper behaviour, in my opinion, should be to not accept invalid values and make hasValidValue implementation properly check if the item is present or not, but this turns into more complicated work that may even have a breaking changes in behaviour.
This was referenced May 6, 2024
vaadin-bot
added a commit
that referenced
this pull request
May 6, 2024
…19196)" (#19310) (#19311) This reverts commit 63e6dfd. The original fix for the property change event is correct per se, but, unfortunately, we faced an odd side effect in the RadioButtonGroup component that blocks our development process and would be a breaking change for RadioButtonGroup's users. Here are some details: The getValue() method of the RadioButtonGroup (and probably other similar components, like Select and CheckboxGroup) returned an item that was set in setValue() before, even if it was an invalid item, e.g. it's key/id wasn't in the list of items for this component. With this change, the PropertyChangeEvent is triggered, that causes handlePropertyChange and hasValidValue method to be called. hasValidValue doesn't properly check if the item is in the list of items on the server and returns true, that causes a state change in setModelValue, that eventually resets the value to null. In other words, if one wants to set a new value, which isn't present in the item's list, the component set the value to null, which sounds like even a bigger bug. The proper behaviour, in my opinion, should be to not accept invalid values and make hasValidValue implementation properly check if the item is present or not, but this turns into more complicated work that may even have a breaking changes in behaviour. Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 63e6dfd.
The original fix for the property change event is correct per se, but, unfortunately, we faced an odd side effect in the RadioButtonGroup component that blocks our development process and would be a breaking change for RadioButtonGroup's users.
Here are some details:
The
getValue()
method of theRadioButtonGroup
(and probably other similar components, likeSelect
andCheckboxGroup
) returned an item that was set insetValue()
before, even if it was an invalid item, e.g. it's key/id wasn't in the list of items for this component.With this change, the
PropertyChangeEvent
is triggered, that causeshandlePropertyChange
andhasValidValue
method to be called.hasValidValue
doesn't properly check if the item is in the list of items on the server and returns true, that causes a state change insetModelValue
, that eventually resets the value tonull
. In other words, if one wants to set a new value, which isn't present in the item's list, the component set the value tonull
, which sounds like even a bigger bug.The proper behaviour, in my opinion, should be to not accept invalid values and make
hasValidValue
implementation properly check if the item is present or not, but this turns into more complicated work that may even have a breaking changes in behaviour.