Solution 1 :

<textarea maxlength=10 data-limit-row-len="true" rows=20> </textarea>

Problem :

I want to limit the number of characters in a textarea per line. I am using React.

Here is what I have tried so far:

<textarea data-row-maxlength={80} data-limit-row-len="true" rows={20}> </textarea>

The problem is data-row-maxlength is ignored.

I have also tried to find a smart textarea component on npm but couldn’t find one.


Comment posted by React js character limitation

Does this answer your question?

Comment posted by siva

Yeah sorry the question was misleading. I want to limit the number of characters per line and not overall.

Comment posted by siva

This sets the general character limit. But I unlimited characters in general and a character limit per line.

Comment posted by DCR

you would have to use js