react-md icon indicating copy to clipboard operation
react-md copied to clipboard

TextField - maxLength property not passed through to input

Open shaunnez opened this issue 8 years ago • 1 comments

Description

Not sure if this was a design decision, but the "maxLength" attribute that normally gets added as "maxlength" to an tag isn't being passed through.

Currently react-md is simply using it to show the counter (e.g. 3/75 characters). However, the user can type more than the 75 characters. If the maxLength tag was to be appropriately added to the actual raw field than this would solve this (in most browsers)

Images/Screenshots

N/A

Link to a gist or code sample where the issue can be reproduced

N/A

Version

  • React - latest
  • React-MD - latest

shaunnez avatar Sep 25 '18 20:09 shaunnez

Yeah, this was because the material design specs when I created this component required the counter to go past 20. I think it'll be good to add a new prop that will show the counter and pass the maxLength prop down. In v2, i'll make it so the counter isn't directly tied to the maxLength prop and instead a separate component or another prop.

mlaursen avatar Sep 27 '18 18:09 mlaursen