-
Notifications
You must be signed in to change notification settings - Fork 359
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
DataListCheck: decide on one of checked/isChecked and make sure the checked property is propagated on the DOM #6762
Comments
@tlabaj can you take a look at this? Is there are good reason to have redundant props here? |
When you want the checkbox to be uncontrolled (you're not using React state to determine the state of the checkbox) then An example of controlled DataListCheck const [isChecked, setIsChecked] = React.useState(false)
<DataListCheck isChecked={isChecked} onChange={value => setIsChecked(value)} ... /> An uncontrolled DataListCheck example const defaultValue = true
<DataListCheck checked={defaultValue} /> I hope that was clear enough. |
Sorry I forgot to answer here. I am using it the expected way with the Controlled variant and I still get the warnings: My code looks like:
isChecked is obviouly assigned to a boolean, since it's casted. However I still see the warnings in console:
|
I couldn't reproduce this, What version of patternfly-react you're using? |
"@patternfly/react-core": "4.198.5" |
Describe the issue. What is the expected and unexpected behavior?
If providing only the isChecked property to the component we get errors in console:
Passing only the 'checked' property seems to work properly, apart from the DOM not being updated, aka the check attribute never appears on the in the DOM.
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
bug
What is your product and what release version are you targeting?
Anaconda WebUI
The text was updated successfully, but these errors were encountered: