fix(DataListCheck): assign checked prop to correct attribute #7163
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.
What: Closes #6762
Based on the latest update to the DataListCheck component, I changed the attribute to which the
checked
prop was assigned. Having thechecked
attribute on the input element be either of theisChecked
orchecked
props was causing the behavior seen in the linked issue (a console warning of changing from uncontrolled to controlled, or vice versa).With this update, a console warning should only occur if both
checked
andisChecked
props are passed in (which I've noted not to do in the prop descriptions). EDIT: this warning may only appear when testing in a local workspace and may not appear in the preview build.If
checked
is passed in, then it's assigned to the correctdefaultChecked
attribute (previously being assigned to the checked attribute was the reason why the checkbox wasn't updating visually, as it wasn't updating at all I believe). If neither prop is passed in, then the component should act as a normal uncontrolled checkbox.Additional issues: