/    Sign up×
Community /Pin to ProfileBookmark

textarea question

I posted this question, [URL=”http://www.webdeveloper.com/forum/showthread.php?t=156927″]http://www.webdeveloper.com/forum/showthread.php?t=156927[/URL],
a while ago. While I didn’t receive any replies on this forum, I also posted on Google Groups and received the following useful reply from Randy Webb,


*******************************************************

It would make more sense to do self.bc_msg.scrollTop = cursorPosition;

Search the archives for the methods of determining cursorPosition in a
textarea. Then, you don’t have any of the other problems you are
encountering by trying to muck with the cursor/scroll.


*******************************************************

I followed this idea and you can see the results here [URL=”http://www.acollectionofwork.com/textarea/”]http://www.acollectionofwork.com/textarea/[/URL].

However if one enters 4 or 5 lines of text, then places the cursor at the beginning of the textarea, and taps the right arrow key to navigate through the text in the texstarea, then the textarea slowly scrolls down until the line the cursor is on disappears from from view.

The following is a link to the Google Group post which reiterates the problem, although perhaps in a little more detail.

[URL=”http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/f070cbc092d21045/a78133621b7f7376?lnk=gst&q=YATQ&rnum=1#a78133621b7f7376″]http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/f070cbc092d21045/a78133621b7f7376?lnk=gst&q=YATQ&rnum=1#a78133621b7f7376[/URL].

Hope someone can help.

Many thanks,

Jack

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 07.2007 — Why hide the scrollbars?
Copy linkTweet thisAlerts:
@woottonauthorAug 07.2007 — Hello Fang,

I'm writing a messaging client that must mimic the behavior of the gmail chat web client, so cannot and do not want to allow scrollbars.

Many thanks,

Jack
Copy linkTweet thisAlerts:
@woottonauthorAug 09.2007 — Any ideas? Am getting desperate.

Thank you,

Jack
×

Success!

Help @wootton spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...