Skip to content
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 RemoveGenericItemModal Controlled Component Warning #8263

Conversation

llivne
Copy link

@llivne llivne commented May 15, 2022

the following warning is shown when calling RemoveGenericItemModal (e.g. when deleting volumes):

Warning: A component is changing an uncontrolled input of type %s to be controlled. 
Input elements should not switch from uncontrolled to controlled (or vice versa). 
Decide between using a controlled or uncontrolled input element for the lifetime of 
the component. 
More info: https://fb.me/react-controlled-components%s,checkbox, in input
 (created by RemoveGenericItemModal) in label (created by RemoveGenericItemModal)
 in div (created by ModalBody) in ModalBody (created by RemoveGenericItemModal)
 in RemoveGenericItemModal (created by Connect(RemoveGenericItemModal))
 in Connect(RemoveGenericItemModal) (created by inner) 
 in inner in div (created by ModalBody)
 in ModalBody
 in div (created by ComposedModal) 
 in div (created by ComposedModal)
 in ComposedModal
 in Provider

image

I added the force to the state making the React state be the “single source of truth”.

@miq-bot
Copy link
Member

miq-bot commented May 15, 2022

Checked commit Autosde@71ded12 with ruby 2.6.9, rubocop 1.19.1, haml-lint 0.35.0, and yamllint
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@Fryguy
Copy link
Member

Fryguy commented May 19, 2022

@jeffibm Please review.

@jeffibm
Copy link
Member

jeffibm commented May 20, 2022

Added additional After screenshots for Sprint review documentation.

Before
image

After
image

@jeffibm jeffibm merged commit dc5921b into ManageIQ:master May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants