Closed Bug 572649 Opened 14 years ago Closed 14 years ago

Attempting to scroll a textarea with a horizontal scrollbar using the mouse jumps to its bottom right (focusing a textarea with the mouse scrolls the selection into view)

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: john.p.baker, Assigned: ehsan.akhgari)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

Attached file testcase
This has hit me a few times over the last couple of days when viewing text in a textarea. 1) Load attachment 2 [review]) Click on scrollbar to move down (or right) Textarea becomes positioned at last character. Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.3a6pre) Gecko/20100616 Minefield/3.7a6pre
Similarly context-clicking in the unfocussed textarea.
ehsan, you seem to have done a few changes in this area recently.
This happens because the textarea is focused when you click a scroll button, which causes us to scroll its selection into view, which causes this behavior (see bug 353539 where this behavior was added). I guess we could detect that we're getting the focus because of a click on the scrollbar, but I'm not sure how to do that.
Blocks: 353539
Summary: Scrolling unfocused textarea leaps to bottom right. → Attempting to scroll a textarea with a horizontal scrollbar using the mouse jumps to its bottom right
I think we can distinguish click-to-focus from other kinds of focus. We shouldn't scroll into view when clicking to focus.
(In reply to comment #4) > I think we can distinguish click-to-focus from other kinds of focus. We > shouldn't scroll into view when clicking to focus. It may not only be click-to-focus 1) Load attachment. 2) Press tab key.
blocking2.0: --- → ?
blocking2.0: ? → betaN+
Summary: Attempting to scroll a textarea with a horizontal scrollbar using the mouse jumps to its bottom right → Attempting to scroll a textarea with a horizontal scrollbar using the mouse jumps to its bottom right (focusing a textarea with the mouse scrolls the selection into view)
Neil, could you please answer comment 4?
You can detect what method was last used to focus with nsIFocusManager::GetLastFocusMethod But why do you want to special case this considering comment 5? Shouldn't the textarea already be scrolled to the caret to start with?
Hmm, I guess one solution would be to initialize the selection to the beginning of the textarea initially instead of its end, but I'm not sure if we want that. That's what Webkit does BTW.
In general, though, caret position can be outside of the visible area due to mousewheel scrolling.
(In reply to comment #9) > In general, though, caret position can be outside of the visible area due to > mousewheel scrolling. Hmm, yes. So, in that case, I'm not really sure how to address this problem.
We can make clicking in the scrollbar focus the textarea without scrolling anything into view. Ehsan, do you want this?
(In reply to comment #11) > We can make clicking in the scrollbar focus the textarea without scrolling > anything into view. What about comment 5? > Ehsan, do you want this? Sure.
Assignee: nobody → ehsan
It's not clear to me that scrolling the caret into view when we tab into the control is wrong, whereas it seems to clear to me that this bug as filed (comment #0) is a real bug.
Attached patch Patch (v1)Splinter Review
Attachment #476954 - Flags: review?(roc)
Flags: in-testsuite+
Target Milestone: --- → mozilla2.0b7
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Verified. [That makes my CMS usable again.] Mozilla/5.0 (Windows NT 5.0; rv:2.0b7pre) Gecko/20100922 Firefox/4.0b7pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: