Closed
Bug 353539
Opened 18 years ago
Closed 15 years ago
textarea.focus() puts caret at end without scrolling it into view
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a4
People
(Reporter: jruderman, Assigned: ehsan.akhgari)
References
Details
(Keywords: access, testcase)
Attachments
(2 files, 2 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce:
1. Load the testcase.
2. Click the button labeled "Focus the textarea".
3. Wonder whether anything happened.
4. Press an arrow key.
5. Realize there was a blinking insertion point at the end of the textarea, where it was invisible because it was scrolled off.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
See also bug 232405, "textbox/textarea doesn't scroll if I change cursor position with setSelectionRange, selectionStart, etc."
Updated•18 years ago
|
QA Contact: editor
Comment 4•17 years ago
|
||
Comment 5•17 years ago
|
||
It should be noted that also happens on Win/Linux amd64/x86
Comment 6•17 years ago
|
||
I think you want to do async scroll here, unless there's a very strong reason to do sync. The sync scroll won't flush out layout before scrolling, so if the content gets updated but layout hasn't changed yet (e.g. if we make setting .value not flush layout) the scroll attempt could fail (because there's nothing to scroll to yet).
I wonder whether it's possible to write a test for this, actually...
I can't think of anything offhand that would break with an async scroll.
Comment 7•17 years ago
|
||
Here comes the asynchronous version.
It doesn't seem that it fully fixes the current issue... (check the testcase attached to this bug), but it at least makes testcases from bug 232405 and bug 231389 working...
Attachment #288673 -
Attachment is obsolete: true
Comment 8•17 years ago
|
||
Hmm. That's very odd. I would expect it to work just fine on the testcase in this bug...
Comment 9•17 years ago
|
||
Any chance it gets approval? It at least fixes some of the major issues..
Comment 10•17 years ago
|
||
Well. If it doesn't fix this bug, then it's kind of wrong, no? Can you tell what's going on?
Comment 11•17 years ago
|
||
Well, it fixes the other two bugs ;)
Comment 12•17 years ago
|
||
It's attached to this bug, though. And the point is, if it doesn't fix this bug something is wrong. Which means it's likely to break other things. And at this point in the cycle we'd rather let old bugs be than create new ones.
If you don't plan to debug what's going wrong with the latest patch, please let me know and I'll try to find time to, I guess...
Comment 13•17 years ago
|
||
OK, over here neither of the two patches fixes this bug. This is no surprising: the focus() call doesn't even end up in SetSelectionInternal().
Sounds like the second patch should be placed on a bug it does in fact fix (at which point we should indeed review it and check it in), and we still need a fix for this bug.
Comment 14•17 years ago
|
||
Comment on attachment 288837 [details] [diff] [review]
mozilla-input-selection-scroll-on-focus.patch
Nice catch, so marking this one obsolete ;)
Attachment #288837 -
Attachment is obsolete: true
Assignee | ||
Updated•15 years ago
|
OS: Mac OS X → All
Hardware: PowerPC → All
Assignee | ||
Comment 15•15 years ago
|
||
Patch + test
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Attachment #432861 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 16•15 years ago
|
||
Comment on attachment 432861 [details] [diff] [review]
Patch (v1)
bz's out, switching the review request to roc.
Attachment #432861 -
Flags: review?(bzbarsky) → review?(roc)
Attachment #432861 -
Flags: review?(roc) → review+
Assignee | ||
Comment 17•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a4
Comment 18•6 years ago
|
||
Keywords: access
Comment 19•6 years ago
|
||
Keywords: sec508
Updated•5 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•