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

Bug 347383

Summary: [client] directory prompter is not responsive to the enter key
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Nayna Jain <jainnayna>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon, simon_kaegi, susan
Version: 0.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2011-05-26 18:39:08 EDT
If I select a directory and press 'Enter' the dialog does not dismiss.
This behavior is supposed to be inherited from _OrionDialogMixin but it is not working.  It is working from the other dialogs, so we need to understand the difference.
Comment 1 Susan McCourt CLA 2011-05-26 18:41:05 EDT
I just realized that the enter key is responsive if the focus is not in the tree.  So it's probably a matter of hooking enter on the tree in the same way that _OrionDialogMixin hooks it on the main domNode.

Note also that if you do dismiss it via the enter key (when focus is not on the tree), there are errors in the console.

exception in animation handler for: onEnd
fx.js (line 153)
TypeError: this._fadeOutDeferred is undefined
this._fadeOutDeferred.callback(true); 

Don't worry too much about these.  We are getting dojo dialog animation errors pretty badly on FF4/dojo 1.6.1 and I'm going to look into a more general solution for that.
Comment 2 Mark Macdonald CLA 2011-06-08 14:49:48 EDT
The NewSiteDialog has this issue too: ENTER does nothing when focus is in the text input field.
I noticed this code in _OrionDialogMixin:

> dojo.connect(this, "onKeyPress", dojo.hitch(this, function(evt) {
> 	if (evt.keyCode === dojo.keys.ENTER) {
>		this._onSubmit();
> 	}
> }));

Attaching a listener to the widget itself seems to only deliver DOM events from the widget's domNode, but not bubbled events from child DOM nodes. If we explicitly listen to the domNode and use the DOM-style "onkeypress" event type instead:

> dojo.connect(this.domNode, "onkeypress", dojo.hitch(this, function(evt) {
>	if (evt.keyCode === dojo.keys.ENTER) {
>		this._onSubmit();
>	}
> }));

... the listener is called with the bubbled event, so _onSubmit() is invoked on ENTER.
Comment 3 Mark Macdonald CLA 2011-06-08 15:12:05 EDT
(In reply to comment #2)
My last comment was wrong. The reason NewSiteDialog didn't work was an error in my code. Unrelated to the directory prompter issue.
Comment 4 Susan McCourt CLA 2011-06-08 19:01:58 EDT
i'll take this since it's a general problem in the mixin.  I noticed the same problem in the link dialog today.
Comment 5 Susan McCourt CLA 2011-06-08 21:53:01 EDT
never mind, this does seem to be specific to the dir prompter.  (Link dialog is working).
Comment 6 John Arthorne CLA 2015-04-27 10:39:26 EDT
Working now