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

Bug 335779

Summary: [Tree][CellEditor] Left Arrow key in cell editor makes TreeItem collapse
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: stefan.fink
Version: 1.4   
Target Milestone: 1.4 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Ralf Sternberg CLA 2011-01-29 15:36:22 EST
Pressing the left arrow key in a Tree cell editor causes the current TreeItem to collapse and thus kills the active cell editor.
Comment 1 Stefan Fink CLA 2011-02-01 15:49:00 EST
It can be reproduced on OS X 10.5.x with Firefox 3.6.x, Safari 5.0.x and Chrome 8.0.x.

Arrow key up and down move the editor cursor to the first and last position of the text but also the selected line in the tree is moved accordingly.

Actually all key presses are handled by the cell editor correctly but then propagated further on to the tree - which leads to the odd behaviour.

It can be tested at:  http://rap.eclipsesource.com/rapdemo/examples#Tree
Comment 2 Ivan Furnadjiev CLA 2011-04-19 09:02:37 EDT
Created attachment 193575 [details]
Proposed patch

This patch stops the propagation of key press event in case of arrow keys and enabled text field. It is done in TextField that Text and CCombo widgets (used for cell editors) can both benefit from it. Are there any use case where this event have to be propagated?
Comment 3 Ivan Furnadjiev CLA 2011-05-03 05:40:54 EDT
In SWT the all key events are "consumed" by the Text widget and don't propagate to its parent. We should do it in the same way - not only for arrow keys.
Comment 4 Ivan Furnadjiev CLA 2011-05-03 06:41:43 EDT
Fixed in CVS HEAD by stopping the propagation of keypress event in TextField.js. JS tests added.
Comment 5 Ivan Furnadjiev CLA 2011-05-04 12:29:11 EDT
Just for the record - Tab keypress have to be propagated to the parent for correct focus handling. Changes are in CVS HEAD.