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

Bug 391081

Summary: Context menu allows change of selection
Product: [RT] RAP Reporter: Markus Krüger <webmaster>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: tbuschto
Version: 1.5   
Target Milestone: 2.0 M3   
Hardware: All   
OS: Windows 7   
Whiteboard: sr152
Attachments:
Description Flags
The app with the bug. none

Description Markus Krüger CLA 2012-10-04 00:44:20 EDT
When I open the context menu of a tree or table, I can still change the selection behind the context menu by using the arrow keys. That way it is possible to call a handler on an item, that it actually was disabled on.

I attached an example app with a view where it should be possible to call a delete handler on "Item 0.4". If you open the context menu on this item, the handler is active and can be called. A message will appear that states its deletion. Now, if you open the context menu on this item and then move up- or downwards with the arrow keys, you can still click on "Delete". The result is, that the global selection is on the new item that would be deleted. 

Tested in IE 9 and Firefox 12.
Comment 1 Markus Krüger CLA 2012-10-04 00:44:45 EDT
Created attachment 221875 [details]
The app with the bug.
Comment 2 Ivan Furnadjiev CLA 2012-10-04 02:45:24 EDT
Reproducible with Control Demo -> Table tab. Right-click on the table to show the context menu. Use arrow keys to navigate in Table. In SWT the arrow keys navigate the Menu. It seems that in RAP the focus is still on the Table when context menu is opened.
Comment 3 Tim Buschtoens CLA 2012-11-05 09:02:26 EST
Fixed with commit fa031fba1b2ebae197c01f49316bcc819eb4f175. The menu was not correctly focused because the ClientDocument was used as a focus root, not the Shell. Fixed by setting the correct opener when the menu appears.

There seems to be another issue, but i opend a separate bug for this: Bug 393557
Comment 4 Ralf Sternberg CLA 2013-01-14 10:50:32 EST
+1 to backport the fix to 1.5.2
Comment 5 Ivan Furnadjiev CLA 2013-01-18 08:42:57 EST
Backported to 1.5-maintenance branch with commit 29a1771f7c862f3a14296b9006ec58023f7f44c8.