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: SlideToggle console errors #980

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Conversation

nataliepina
Copy link
Collaborator

@nataliepina nataliepina commented Jul 11, 2023

Closes D2IQ-98165

Description

I discovered console errors around the SlideToggle component. One around the value and one around checked. The error suggests the use of defaultValue and defaultChecked. Using these resolved the error.

You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.

Screenshot 2023-07-07 at 1 53 05 PM (1)

Which issue(s) does this PR relate to?

Testing

View the console while looking at the SlideToggle story.

Trade-offs

Screenshots'

Before
Screenshot 2023-07-11 at 9 43 52 AM

After
Screenshot 2023-07-11 at 9 41 46 AM

Checklist

  • This PR is associated with a JIRA and it is mentioned in the commit message footer ("Closes …")
  • Significant changes have been tested downstream to avoid breaking changes
  • This PR contains breaking changes and states in the commit message body ("BREAKING CHANGE: …")
  • I have reviewed the changes and provided detail to the sections above

@nataliepina nataliepina requested a review from a team as a code owner July 11, 2023 14:45
@nataliepina nataliepina changed the title fix: slideToggle console errors fix: SlideToggle console errors Jul 11, 2023
@github-actions
Copy link

github-actions bot commented Jul 11, 2023

Uffizzi Preview deployment-30659 was deleted.

const parentDataCy = [
`${inputType}`,
...(checked ? [`${inputType}.checked`] : []),
...(appearance && appearance !== InputAppearance.Standard
? [`${inputType}.${appearance}`]
: [])
].join(" ");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After seeing a lot of code blocks recently with no blank lines in between at all I'm really pleased to see this!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, glad you think so too!

@nataliepina nataliepina merged commit f8823f6 into main Jul 11, 2023
5 checks passed
@nataliepina nataliepina deleted the npina/fix/D2IQ-98165-slidetoggle branch July 11, 2023 15:36
@github-actions
Copy link

🎉 This PR is included in version 14.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

2 participants