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(NumberInput): restore defaultValue prop functionality in uncontrolled number input #7312

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Nov 18, 2020

Closes #7299

This PR restores functionality to the defaultValue prop in uncontrolled number inputs and removes the React warning about setting both defaultValue and value on the input

Changelog

New

  • uncontrolled number input defaultValue test

Changed

  • avoid spreading defaultValue into input
  • add defaultValue typecheck
  • remove default internal state value in gDSFP

Testing / Reviewing

Confirm that setting a defaultValue on an uncontrolled number input works as expected and the correct value is displayed on render

@emyarod emyarod requested a review from a team as a code owner November 18, 2020 15:44
@emyarod emyarod force-pushed the 7299-uncontrollednumberinput-defaultvalue branch from 315c2bb to 6797fff Compare November 18, 2020 15:45
@netlify
Copy link

netlify bot commented Nov 18, 2020

Deploy preview for carbon-elements ready!

Built with commit 315c2bb

https://deploy-preview-7312--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Nov 18, 2020

Deploy preview for carbon-components-react ready!

Built with commit 315c2bb

https://deploy-preview-7312--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Nov 18, 2020

Deploy preview for carbon-elements ready!

Built with commit 16ae7c4

https://deploy-preview-7312--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Nov 18, 2020

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit 16ae7c4

https://deploy-preview-7312--carbon-components-react.netlify.app

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

looks good! @emyarod

@kodiakhq kodiakhq bot merged commit 656e084 into carbon-design-system:master Nov 18, 2020
@emyarod emyarod deleted the 7299-uncontrollednumberinput-defaultvalue branch November 19, 2020 15:27
@emyarod emyarod mentioned this pull request Nov 30, 2020
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NumberInput: uncontrolled NumperInput not respecting defaultValue
4 participants