-
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
feat(react): enable textarea to limit text input to set amount of words #12906
feat(react): enable textarea to limit text input to set amount of words #12906
Conversation
Co-authored-by: SamChinellato <[email protected]> Co-authored-by: stevenpatrick009 <[email protected]>
DCO Assistant Lite bot All contributors have signed the DCO. |
I have read the DCO document and I hereby sign the DCO. |
recheck |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@matejoslav thank you so much for the PR. Two things as you're building this out.
|
Fix tests affected by the merge to properly use the selected testing library. Change TextArea component to remove duplicated use of the useRef hook.
@sstrubberg Good points. For point number 2, will make relevant doc updates and push them. For point number 1, wanted to make the component behave in similar way to having a maximum character limit, at the moment the user cannot exceed the amount of words if they have reached the limit, the announcer message is also displayed showing 0 words left. Not sure if a more visual error handling is needed but happy to add one if you think it would benefit the user experience. |
Just checked the website repo, is it okay to assume that this change would have to be merged first and then we would add the feature description there or would you want them to be done at the same time? |
correct, merge first, then document. Just didn't want that part to get lost :) |
@matejoslav Looks like all-contributors needs to be ran again to resolve the conflict with |
Bump @matejoslav |
Hello, I am looking into it now 👍 |
For some reason I am getting test failure for "Simple date picker › should initialize a calendar when using react.lazy" |
@francinelucca check please if it now works as expected |
The contributorsrc and Readme seem to have been altered and the order of the people was changed, could you please check and advise what to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook issue seems to be fixed now, LGTM!
Might be worth to copy/paste the file from main, add your changes and commit to solve conflicts, your call though! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ds (carbon-design-system#12906) * feat(react): enable textarea to limit text input to set amount of words Co-authored-by: SamChinellato <[email protected]> Co-authored-by: stevenpatrick009 <[email protected]> * test(textArea): fix tests and component Fix tests affected by the merge to properly use the selected testing library. Change TextArea component to remove duplicated use of the useRef hook. * docs(developer handbook): change max characters for line in commit body * fix(docs): regenerated contributors to resolve merge conflict * revert sync file changes * fix(TextArea): fixed eslint complaints * refactor(TextArea): changes to counterMode and storybook changed wording for counterMode to be character or word removed storybook entry * refactor(TextArea): removed unused test * docs(README): added contributors * revert(package.json & developer-handbook.md): reverted 90 limit to 80 * chore(format): run yarn format * fix(README): fixed the contributors formatting * refactor(TextArea): function to get initial text count * refactor(useAnnouncer): made entityName have default value * refactor(TextArea): use function to calculate text count in useEffect * fix(TextArea): ignore max count limit when counter is disabled * fix: fixed contributors list * chore(TextArea): trim words on paste and add missing tests * chore(TextArea): remove console log * chore: Update packages/react/src/components/TextArea/__tests__/TextArea-test.js Co-authored-by: Francine Lucca <[email protected]> * chore: remove redundant event definition in test * fix(TextArea): fix count not updating when switching mode * fix(TextArea): fix onPaste function * fix(TextArea): fix lint errors and tests logic * fix(contributors): revert list to what is on main * fix: add contributors --------- Co-authored-by: SamChinellato <[email protected]> Co-authored-by: stevenpatrick009 <[email protected]> Co-authored-by: TJ Egan <[email protected]> Co-authored-by: Andrea N. Cardona <[email protected]> Co-authored-by: Francine Lucca <[email protected]>
Co-authored-by: SamChinellato [email protected]
Co-authored-by: stevenpatrick009 [email protected]
Closes #13788
Added functionality to textArea component to limit the number of words the user can type. Also updated the useAnouncer to handle new wording by allowing it to either display "x characters left" or "x words left" based on args passed in.
Changelog
New
Changed
Testing / Reviewing