-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: pass defaultValue
in to textarea and text input initial state
#3015
Conversation
Deploy preview for the-carbon-components ready! Built with commit bcf9cbd https://deploy-preview-3015--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit bcf9cbd |
Deploy preview for carbon-components-react failed. Built with commit bcf9cbd https://app.netlify.com/sites/carbon-components-react/deploys/5cffee34cb405a00080422e1 |
Does this have a test already for defaultValue or should we add one too? |
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 |
…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.
…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.
…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.
Closes #3013
The
useState
hook is setting the initial value of the<TextInput>
and<TextArea>
components as an empty string. This PR passes thedefaultValue
prop in as the initial component valueTesting / Reviewing
Ensure that the default value can be set for the two components