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: pass defaultValue in to textarea and text input initial state #3015

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Jun 11, 2019

Closes #3013

The useState hook is setting the initial value of the <TextInput> and <TextArea> components as an empty string. This PR passes the defaultValue prop in as the initial component value

Testing / Reviewing

Ensure that the default value can be set for the two components

@netlify
Copy link

netlify bot commented Jun 11, 2019

Deploy preview for the-carbon-components ready!

Built with commit bcf9cbd

https://deploy-preview-3015--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Jun 11, 2019

Deploy preview for carbon-elements ready!

Built with commit bcf9cbd

https://deploy-preview-3015--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Jun 11, 2019

Deploy preview for carbon-components-react failed.

Built with commit bcf9cbd

https://app.netlify.com/sites/carbon-components-react/deploys/5cffee34cb405a00080422e1

@joshblack
Copy link
Contributor

Does this have a test already for defaultValue or should we add one too?

@emyarod
Copy link
Member Author

emyarod commented Jun 11, 2019

this should cover it https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/TextInput/TextInput-test.js#L77-L81

some of these tests look stale though, will refactor them

@asudoh asudoh merged commit d563edf into carbon-design-system:master Jun 12, 2019
@emyarod emyarod deleted the 3013-textarea-textinput-defaultvalue branch June 13, 2019 14:20
emyarod added a commit that referenced this pull request Jun 18, 2019
asudoh pushed a commit that referenced this pull request Jun 20, 2019
…l state" (#3106)

* Revert "fix: pass `defaultValue` in to textarea and text input initial state (#3015)"

This reverts commit d563edf.

* Revert "feat: text input and textarea character limit counter (#2745)"

This reverts commit 919ba2e.
cal-smith pushed a commit to cal-smith/carbon-components that referenced this pull request Jun 21, 2019
…l state" (carbon-design-system#3106)

* Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)"

This reverts commit d563edf.

* Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)"

This reverts commit 919ba2e.
cal-smith pushed a commit to cal-smith/carbon-components that referenced this pull request Jun 21, 2019
…l state" (carbon-design-system#3106)

* Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)"

This reverts commit d563edf.

* Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)"

This reverts commit 919ba2e.
cal-smith pushed a commit to cal-smith/carbon-components that referenced this pull request Jun 21, 2019
…l state" (carbon-design-system#3106)

* Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)"

This reverts commit d563edf.

* Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)"

This reverts commit 919ba2e.
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.

TextArea and TextInput can't be pre-populated with value
4 participants