Skip to content

Your TextArea will atomatically resize to fit the user input.

License

Notifications You must be signed in to change notification settings

nathanaelsousa/autoResizeTextArea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoResizeTextArea

const  module =  autoResizeTextArea({ele, minHeight, maxHeight)  


ele   The textarea element.
minHeight   The height won't get smaller than this.
maxHeight   The height won't get bigger than this.


module.onKeyDown
An eventMethod. You can assign a function to this method and this function will be executed when the user types a letter.


module.onTypedNewLine
If the page is scrollable and the user is typing a new line out of the viewport the browser by default scrolls down so the line which the user is in becomes visible. You might want to scroll a little more to show some related button or to center correctly the bottom of the element. When this happens this module will call it's onTypedNewLine method and you can assign a function to it and make the adjustments that you need.


module.reset()
It resets the height of the element to the minHeight. You can use it if you have emptied the textAreaElement.value and want that the height is restored to the min.


module.forceTest()
Retest the element height.

About

Your TextArea will atomatically resize to fit the user input.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published