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

TextField maxLength property does not work for number type #4468

Closed
jt274 opened this issue Sep 7, 2021 · 6 comments
Closed

TextField maxLength property does not work for number type #4468

jt274 opened this issue Sep 7, 2021 · 6 comments
Labels
Bug Something is broken and not working as intended in the system. no-issue-activity untriaged

Comments

@jt274
Copy link

jt274 commented Sep 7, 2021

Issue summary

When using the TextField component, the maxLength property does not work when the type property is set to number.

Expected behavior

Behavior should be the same for all types. A maxLength of 3 with the type set to number should not allow the input of 1234.

Actual behavior

There is no limit to the amount of numbers that can be input.

Steps to reproduce the problem

<TextField
  label="Type a number"
  value={value}
  onChange={handleChange}
  maxLength={3}
  type="number"
  showCharacterCount={true}
/>

textfield

@jt274 jt274 added the Bug Something is broken and not working as intended in the system. label Sep 7, 2021
@ghost
Copy link

ghost commented Sep 7, 2021

👋 Thanks for opening your first issue. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines.

@NgocLe1001
Copy link

same issue

@github-actions
Copy link
Contributor

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's design system and dev experience.

@yvan-sevic
Copy link

This is still an issue.

@EliottPal
Copy link

November 2024 and this is still an issue...

@ashok-essence
Copy link

As of February 10, 2025, the issue still persists. However, I was able to make it work in my case by using the onChange event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. no-issue-activity untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants