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

RESOLVED FIXED in mozilla1.9.3a4

Status

()

Core
Editor
RESOLVED FIXED
14 years ago
8 years ago

People

(Reporter: surkov, Assigned: Away for a while)

Tracking

({sec508, testcase})

Trunk
mozilla1.9.3a4
sec508, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed by bug 231389])

Attachments

(2 attachments)

728 bytes, application/vnd.mozilla.xul+xml
Details
794 bytes, text/html
Details
(Reporter)

Description

14 years ago
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:
(Reporter)

Comment 1

14 years ago
Created attachment 140056 [details]
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

Comment 3

12 years ago
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.

Comment 4

12 years ago
Created attachment 239400 [details]
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

Comment 5

11 years ago
Bug 231389 has a solution for this problem.

Updated

11 years ago
Depends on: 231389

Updated

10 years ago
Duplicate of this bug: 414066
(Assignee)

Comment 7

8 years ago
My patch in bug 231389 fixes this problem.
Assignee: nobody → ehsan.akhgari
Status: NEW → RESOLVED
Last Resolved: 8 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.