DEV Community

loading...

Restrict input in textarea

Jannik Wempe
Serverless and Frontend Enthusiast
ใƒป1 min read

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.

Discussion (1)

Collapse
sbalasa profile image
Santhosh Balasa • Edited

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