Fixes checked property being reset on render #2907
Merged
+30
−15
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.
If the value is uncontrolled, do not touch it. Only if it is explicitly given (controlled) set it with every render.
A boolean attribute can have two states: it can exist or be omitted (
true
andfalse
).A boolean property can have three states in vdom: it can be explicitly assigned
true
, explicitly assignedfalse
or it can be left uncontrolled. The last has been missing and the buggy behaviour assumes the last is synonymous with "explicitly false".Marked as a breaking change, because the API exposed by vdom changes slightly. This is not technically necessary for the PR, but it should serve as a reminder for anybody using the method that there was something subtly wrong with it, as it also assumed a default-unchecked which is not true.
Description
Fixes #2875. I will add tests when I have time in the coming days.
Checklist