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

Bug 480998

Summary: Crash when tabbing through View parts with contribution items
Product: [RT] RAP Reporter: Martin Domig <martin>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.3   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/#/c/59350/
Whiteboard:
Attachments:
Description Flags
Workbench demo / selection view: include a HelpSearchContributionItem in the selection view, changes setFocus() to set the focus to a label instead
none
Proposed fix: test if _hoverItem has a _onKeyDown / _onKeyUp function before calling it none

Description Martin Domig CLA 2015-10-29 09:54:40 EDT
Created attachment 257623 [details]
Workbench demo / selection view: include a HelpSearchContributionItem in the selection view, changes setFocus() to set the focus to a label instead

When a view title has focus, the client crashes when "tabbing away" from it - if the view has a contribution item.

Steps to reproduce:
1. apply the attached patch to the workbench demo.
2. start the workbench demo.
3. select something so that the selection view shows some content.
4. click on the title of the selection view.
5. hit tab twice - you should get the stack trace below.

We can reproduce this in RAP 2.3, 3.0 and 3.1.

It seems related to the focus bug #439044: if setFocus() of the selection view gives the focus to the list, this bug does not trigger (but then the contribution is useless). If the focus is given to the label instead, the bug triggers.

I'll also attach a proposed fix.


Stack trace:

Error: TypeError: this._hoverItem._onKeyUp is not a function. (In 'this._hoverItem._onKeyUp( event )', 'this._hoverItem._onKeyUp' is undefined)

  line: 52495
  column: 33
  sourceURL: http://localhost:9090/rwt-resources/rap-client.js
  Stack: _onKeyUp@http://localhost:9090/rwt-resources/rap-client.js:52495:33
_dispatchEvent@http://localhost:9090/rwt-resources/rap-client.js:3865:22
dispatchEvent@http://localhost:9090/rwt-resources/rap-client.js:3806:26
_processKeyEvent@http://localhost:9090/rwt-resources/rap-client.js:15410:28
_onkeyevent_post@http://localhost:9090/rwt-resources/rap-client.js:15366:28
_onKeyEvent@http://localhost:9090/rwt-resources/rap-client.js:15347:30
http://localhost:9090/rwt-resources/rap-client.js:624:22
  Debug: on
Comment 1 Martin Domig CLA 2015-10-29 09:55:39 EDT
Created attachment 257624 [details]
Proposed fix: test if _hoverItem has a _onKeyDown / _onKeyUp function before calling it
Comment 2 Ivan Furnadjiev CLA 2015-11-10 03:06:10 EST
Fixed with change https://git.eclipse.org/r/#/c/59350/.