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

Minlength/maxlength support for textarea elements #54

Open
xsynaptic opened this issue Apr 18, 2017 · 1 comment
Open

Minlength/maxlength support for textarea elements #54

xsynaptic opened this issue Apr 18, 2017 · 1 comment

Comments

@xsynaptic
Copy link

I noticed that minlength/maxlength checks don't seem to work for textarea elements. I traced this back to this conditional check in validators/minlength.js: text_types.indexOf(get_type(element)) === -1. This fails as textarea is not in the text array in components/types.js. Not sure if this is oversight or by design... but adding it to that array addresses the issue from what I can tell.

Thanks for your work on this great package!

@Boldewyn
Copy link
Contributor

Thanks for the issue, and sorry for the delay in answering it! Yes, at the moment this is by design to keep as close to the spec as possible. (There's no (min|max)length to textarea in the HTML5 spec for god-knows-why reasons.)

However, I'm at work (cf. issue #14) to open up the inner workings of Hyperform, so that a plugin could attach itself to certain points to provide this feature. I am also quite sure, that I'd provide such a plugin immediately myself, since I found myself in the situation as well to restrict char counts in textareas.

Long story short: Look out for #14 to be closed, and I keep this one open to track progress on a to-be-written plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants