Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334755 - [Combo] Selected item not visible in the list if it was scrolled before
Summary: [Combo] Selected item not visible in the list if it was scrolled before
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 06:00 EST by Ivan Furnadjiev CLA
Modified: 2011-03-23 13:00 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 Ivan Furnadjiev CLA 2011-01-19 06:00:39 EST
Reproducible with Controls Demo:
1. Start Controls Demo -> Button Tab
2. Open Cursor combo drop-down list and scroll it, to make the "null" selection not visible anymore
3. Click somewhere else to close the drop-down list.
4. Open the drop-list again - scroll offset is on the old position and the selected item is not visible.
With the new Scrollbar implementation the ListItem#scrollIntoView() is not working anymore.
Comment 1 Tim Buschtoens CLA 2011-03-23 12:45:14 EDT
The scrollIntoView call is actually working, its more an issue of the order in which it is called:

- list.setDisplay( true ) is called in Combo.js
- flush
- in Combo the lists appear event causes the scrollIntoView call
- scrollIntoView works like expected, but the resulting dom-scroll-event is not fired until the javascript thread is free again.
- Next in Scrollable#_onClientAppear "_syncClientArea" is called, which 
sets the clientArea (the actual list) back to the (unchanged) scroll-position stored in the ScrollBar.
- After all that the dom-scroll-event is finally fired, triggering Scrollable#_onscroll, which then in turn calls "_syncClientArea", trying to store the new scroll position in the scrollbar, which should have happend before it got reset.

So basically, the problem is a combination of the fact that dom-events dont get fired while javascript is processed and that Combo gets the appear event before the list itself does.
Comment 2 Tim Buschtoens CLA 2011-03-23 12:49:30 EDT
Correction: the second "_syncClientArea" should actually be "_syncScrollBars"
Comment 3 Tim Buschtoens CLA 2011-03-23 13:00:23 EDT
Fixed in CVS HEAD by calling "_syncScrollBars" explicitly after "scrollIntoView".