Download & Extend

textarea focua (push quicktag button = cursor jumps to top)

Project:quicktags
Version:master
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Someone posted this on the homepage for this great module a while back:

whenever you use any of the included markup buttons, the textarea focus returns to the top of the document. For editing anything longer than a paragraph or two, this is really hard for users, as they immediately loose their place in the document.

That was over a year ago and it doesnt seem to have been brought up here. I also find this annoying. Anyone have ideas for a fix?

Comments

#1

I cannot replicate this on my system using either firefox 2.0.0.9 or IE 7.x
since this has been open for so long with no other feedback, I vote to close this issue.

#2

I had this issue in Firefox 3b2. I added two lines to the javascript and it's now gone.
At the beginning of edInsertTag function:
prevTop = myField.scrollTop;
at the end of the function:
myField.scrollTop = prevTop;

The same could be probably added to edInsertContent too.

#3

Status:active» postponed (maintainer needs more info)

Could you provide a patch for this?

#4

Version:5.x-1.x-dev» master
Status:postponed (maintainer needs more info)» needs review

I finally had a chance to add these lines to the JS at both edInsertTag and edInsertContent and create a patch (attached).
Let's get some testing and feedback on this.

Reassigning to HEAD since that's where modifications should go.

+1 on works for me.

AttachmentSize
quicktags.js_.textarea-focus.patch 874 bytes

#5

I've applied the patch.

Works better in Firefox now. Doesn't jump back to the top of the text.

Jan

#6

Status:needs review» reviewed & tested by the community

I've tested this extensively at a couple of sites and it fixes the issue. It should definitely be part of the next release.

#7

Status:reviewed & tested by the community» fixed

Since this effectively repairs a bug I've committed it to CVS Head.
I'm hoping to get some of the more ready patches committed before branching off for Drupal 6.x (No I don't have a specific time for a branch).

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here