polaris icon indicating copy to clipboard operation
polaris copied to clipboard

TextField maxLength property does not work for number type

Open jt274 opened this issue 3 years ago • 1 comments

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 avatar Sep 07 '21 04:09 jt274

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

ghost avatar Sep 07 '21 04:09 ghost

same issue

NgocLe1001 avatar Jan 05 '23 07:01 NgocLe1001

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.

github-actions[bot] avatar Apr 16 '23 03:04 github-actions[bot]

This is still an issue.

yvan-sevic avatar Jun 13 '23 02:06 yvan-sevic