Closed Bug 232405 Opened 21 years ago Closed 14 years ago

textbox/textarea doesn't scroll if I change cursor position with setSelectionRange, selectionStart, etc.

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a4

People

(Reporter: surkov, Assigned: ehsan.akhgari)

References

Details

(Keywords: access, testcase, Whiteboard: [fixed by bug 231389])

Attachments

(2 files)

User-Agent:       
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

If I change cursor position in html:input by setSelectionRange() method or by
properties selectionStart and selectionEnd then text isn't scrolled on new
cursor position. 
How can I manage visible text range in this case?

Reproducible: Always
Steps to Reproduce:
Attached file testcase
Editor.
Assignee: general → mozeditor
Status: UNCONFIRMED → NEW
Component: DOM: HTML → Editor: Core
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: ian → sairuh
Hardware: PC → All
This is annoying when using the "Valid XHTML" user script at http://www.squarefree.com/userscripts/valid-xhtml.user.js, because it makes it difficult to see where the error is.  The script is able to select the error but is not able to scroll the textarea to make the error visible.

It might be possible for JavaScript code to work around this bug by setting scrollTop (as in the workarounds for the controversial bug 231389), but that would be hard because I don't know exactly how tall each line of the textarea is.
Keywords: sec508, testcase
Summary: text of html:input don't scroll if I change cursor position by setSelectionRange() method → textbox/textarea doesn't scroll if I change cursor position with setSelectionRange, selectionStart, etc.
Attached file another testcase
This has tests for setting the selection/caret position both before and after focusing the textarea.  The "before" cases might be bug 353539 rather than this bug.
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
Bug 231389 has a solution for this problem.
Depends on: 231389
My patch in bug 231389 fixes this problem.
Assignee: nobody → ehsan.akhgari
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by bug 231389]
Target Milestone: --- → mozilla1.9.3a4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: