fregante / fit-textarea

Automatically expand a <textarea> to fit its content, in a few bytes
https://npmjs.com/fit-textarea
MIT License
78 stars 2 forks source link

Auto-kill when resize events take too long #14

Open fregante opened 3 years ago

fregante commented 3 years ago

As an opt-out behavior, it could measure how long each call takes and if it's above a certain duration it should set the field to a 2:1 ratio with a minimum height of 200px

fitTextarea.watch(field, {maxDuration: 300 /*ms*/})