Skip to content

Check to see if you're at the end of an input element or textarea. Useful for "drifting" textareas.

Notifications You must be signed in to change notification settings

matthewmueller/end-of

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

end-of

Check to see if you're at the end of an input element or textarea. Useful for "drifting" textareas with additional padding at the bottom.

Installation

$ component install matthewmueller/end-of

Example

var endOf = require('end-of'),
    textarea = document.getElementById('content');

endOf(textarea, function(end) {
  if (!end) return;
  textarea.scrollTop = textarea.scrollHeight;
})

API

endOf(el, fn)

Initialize the keydown listener on el.

License

MIT

About

Check to see if you're at the end of an input element or textarea. Useful for "drifting" textareas.

Resources

Stars

Watchers

Forks

Packages

No packages published