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 : Prevents exceeding maxCount word limit in TextAera #16893

Merged

Conversation

2nikhiltom
Copy link
Contributor

Closes #16892

When the maxCount word limit is set along with enableCounter prop , users can bypass this limit by pressing the Enter key, allowing them to enter more words than specified in the next/new line.

This PR will not allow users to press Enter key once the max word limit is reached (like how space key is stoped)

Changelog

New

Adds a new condition for Enter key on onKeyDown function

Testing / Reviewing

Open deploy preview
Visit TextArea -playground storybook

Enable enableCounter prop
Set counterMode to word
Set maxCount to 5
Press Enter key and verify you should not be able to go to next line and type new words, and that word limit is not exceeded.

@2nikhiltom 2nikhiltom requested a review from a team as a code owner June 28, 2024 12:02
Copy link

netlify bot commented Jun 28, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 99858d4
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6682ebc0d14085000898892d
😎 Deploy Preview https://deploy-preview-16893--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 28, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 99858d4
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6682ebc008e15400084cb005
😎 Deploy Preview https://deploy-preview-16893--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@guidari guidari added this pull request to the merge queue Jul 1, 2024
Merged via the queue into carbon-design-system:main with commit e05f46e Jul 1, 2024
22 checks passed
@carbon-automation
Copy link
Contributor

Hey there! v11.61.0 was just released that references this issue/PR.

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.

[Bug]: [TextArea] : Exceeding maxCount Word Limit by Pressing Enter Key
4 participants