DEV Community

Jannik Wempe
Jannik Wempe

Posted on

Restrict input in textarea

Maybe someone already did this or there is a package, which I didn't find.

Problem statement

Restrict the input to a textarea by maximum number of columns (chars in row) and rows.

Current situation

I already have a 90% solution, but there are a lot of edge cases (e.g. pasting text, writing text with visual linebreak but no \n, selecting text and write ...).

Additional information

We do use Vue and Quasar in the project.

Top comments (1)

Collapse
 
sbalasa profile image
Santhosh Balasa • Edited

Add these within the html textarea tags rows="15" cols="130"