No auto-scroll when cursor location is outside of a viewable input field

UNCONFIRMED
Unassigned

Status

()

Core
Editor
UNCONFIRMED
8 years ago
8 years ago

People

(Reporter: Gao, Ying, Unassigned)

Tracking

1.9.1 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)

If we have a input field with size 10.
And we have a long text in the input field which has 20 letters.
call:
inputfield.focus();
inputfield.setSelectionRange(15, 15);

the cursor will be invisible. It's at the correct location. 
But Firefox doesn't auto-scroll. So we end with a disappeared cursor.

IE support auto-scroll when we move cursor to a place autoside the input box.

For example:

<html><body>
<form name="testform">
<input type="text" name="cursortest" value="01234567890123456789" size="10" />

<script type="text/javascript" >
function setCaretTo(obj, pos) { 
    obj.focus(); 
    if(obj.createTextRange) { 
        var range = obj.createTextRange(); 
        range.move("character", pos); 
        range.select(); 
    } else if(obj.selectionStart) { 
        obj.setSelectionRange(pos, pos); 
    } 
}
setCaretTo(document.testform.cursortest, 18);

</script>
</form>
</body>
</html>


Reproducible: Always
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
Version: unspecified → 1.9.1 Branch
You need to log in before you can comment on or make changes to this bug.