Can't seem to find a decent way of doing this. My editor is a full screen editor, not a normal textarea. Its for full screen editing and the issue is, currently, once you reach the end of the page you are always typing at the bottom of the browser window unless you press enter a bunch of times.
I was thinking adding a bunch of \n\n\n\n\n
to the bottom of the textarea that are always there (if you erase them and start typing again it pops them back in), but I wasn't sure how well that'd work or the best way to implement that. Any ideas?
My best idea was, to check if the last N
characters of the textarea value were equal to what i deemed to be a good buffer, i.e. 6 \n
s by doing a little regex. If it was not equal, it'd add it to the bottom and scroll to the bottom (making it look like padding).
Using just JavaScript and jQuery (1.6, so .prop()
examples, not .attr()
!)
Here's a screenshot scrolled down (no padding):
==UPDATE== The problem with padding is that then the editor is seen as not full screen and looks strange:
The solution i think needs to go into modifying the actual text on the fly... maybe