Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 384441

Summary: [Combo] Wrong behavior with arrow keys
Product: [RT] RAP Reporter: Thierry Chantier <titimoby>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 2.0   
Target Milestone: 2.3 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Thierry Chantier CLA 2012-07-06 04:33:55 EDT
I just discovered a strange behaviour of my combo boxes when using arrow keys.
Here are 2 descriptions of what I encountered:

1) Open a combo with enough lines to scroll.
Keep the mouse pointer on one of the elements.
use the down arrow key.
when you reach the last visible element, the combo list is refreshed but the focus is set back on the element under the mouse pointer.

2) Open a combo located in an editor with a scrollbar
when you use the up or down arrow without releasing, the focus is moved to the next element in the combo, and then the editor's scrollbar is moved (or sometimes a "shake effect").

this is true both with RAP 1.4 and 1.5
I have the same when I use the Workbench Demo
Comment 1 Ivan Furnadjiev CLA 2012-07-06 06:17:48 EDT
In SWT Combo there is a functionality to select (highlight) list item by hovering with the mouse. This issue is related to change of the hover item when navigating with the keyboard.
Comment 2 Tim Buschtoens CLA 2012-07-13 06:43:26 EDT
Fixed with commit ec4a5c5720567f9a41a017c3098ea24626058900.

I was not completely sure of issue 2). I had issues with holding down, but not like in the report. Right now it seems fine, except Chrome has a strange issue: Holding down the "Down" key on a cell editor can trigger a mousemove event after a few seconds (fired by the browser, so its not a RAP bug). That can cause the selection to snap back to the hovered item. I dont think its a big problem though.

Combo.js is a mess btw. It would require a big refactoring or re-implementation to be cleaned up.
Comment 3 Thierry Chantier CLA 2012-10-01 12:02:00 EDT
(In reply to comment #2)

I'm reopening the bug because issues are still reproducible with RAP 1.5.1

I will try to explain more precisely the reproducible cases.

Issue 1 is still reproducible on both Chrome 23.0.1271.10 dev-m and Firefox 13.0.1 running on Windows 7 64 bits.
Reproducible case:
1/ Click the drop down button of a combo with enough items to have a scroll-bar (RAP Demo workbench Principal/country combo is a good candidate)
2/ Hover the second item in the drop down list with the mouse
3/ Press the down arrow key several times releasing the key between each stroke. 
4/ Every time the arrow key is pressed the selection moves to the next item as expected.
5/ However when the last visible item is reached the scroll-bar scrolls down.  The selected element is not the next in the list but the one that was hovered.


Issue 2 is also still reproducible on Chrome 23.0.1271.10 dev-m 
Reproducible case:
1/ Focus on a combo with enough items to have a scroll-bar contained in a Form Editor that itself have a scroll-bar. (RAP Demo workbench Principal/country combo is also a good candidate if you reduce the Principal form to have a scroll-bar)
2/ Press without releasing the down arrow key for several seconds. The Content of the Form Editor starts to shake up and down and the combo selection does not change.
Comment 4 Ivan Furnadjiev CLA 2012-10-03 06:42:40 EDT
The issue is fixed in RAP v2.0M1... not in v1.5.1. I can't reproduce the problem with RAP 2.0M1 and will close it again as fixed. Please reopen if the problem is reproducible for you with RAP > 2.0M1.
Comment 5 Thierry Chantier CLA 2013-03-22 12:35:14 EDT
I think this bug needs to be reopened.

1) The first issue is partially solved or at least there is improvement.
If you use the down arrow with enough time between key presses, that's ok.
I you speed up, you still have the focus going up to the mouse pointer.

2) using down key without releasing move one item down and no additional move, or shake : that's ok

if you do the same with the up arrow, the focus moves one item up, then the screen starts a nice shake effect that will stop if you release the up arrow.
Comment 6 Ivan Furnadjiev CLA 2014-04-08 05:26:17 EDT
We completely re-implemented the Combo with change https://git.eclipse.org/r/24466. I can't reproduce any of the mentioned problems anymore.