Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351731 - Weird selection behavior changing direction during auto scroll
Summary: Weird selection behavior changing direction during auto scroll
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.3 M1   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-11 12:14 EDT by Felipe Heidrich CLA
Modified: 2011-09-01 09:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Heidrich CLA 2011-07-11 12:14:17 EDT
In any textview, any browser, 

-have a big file open in the textview
-scroll to center of the file
-click on the center of client area and hold the button down
-move mouse outside the client area to the top and hold it there for a few second so that the textview scrolls up a few pages selecting text
-now, without releasing the button, move the mouse outside the client area to the bottom

the textview will switch direction and start scrolling down and un selects the text previously selected.
but note is it weird:
the textview scroll a page, then it *stops scrolling* and unselects text line per line, then scroll another page, and start again till the view scroll passed the selection anchor.

it should never stop scrolling.

the problem also happens in the opposition direction, scroll down first and up.
Comment 1 Felipe Heidrich CLA 2011-07-11 12:24:37 EDT
This happens because auto scroll uses setSelection() to scroll the page. setSelection() uses showCaret() to scroll, 
showCaret when scroll tries to fit in the client area as much of selection as possible.
Comment 2 Felipe Heidrich CLA 2011-07-11 14:37:06 EDT
fixed

http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=33ead4c3ee21c8925c0390d16b6285107dba07f7
http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=7f432677affd15d497af9994577b6740e5844edd

The problem was also reproducible with using shift+arrow up/down.

I changed the internal _showCaret() to scroll to show only the caret and do not try to show as much as the selection as possible - except when the called from the showSelection() API.