| Summary: | [webadmin] ENTER/ESC key events are not caught in dialogs that have no focus widgets. | ||
|---|---|---|---|
| Product: | [Retired] oVirt | Reporter: | Danny Rankevich <drankevi> |
| Component: | ovirt-engine-webadmin | Assignee: | Vojtech Szocs <vszocs> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | unspecified | CC: | asaf, ecohen, iheim, vszocs |
| Target Milestone: | --- | ||
| Target Release: | 3.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-08-09 07:59:01 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Danny Rankevich
2011-10-27 15:46:40 UTC
Taking this one, I'm gonna try fixing this issue for all WebAdmin dialogs using GWT FocusPanel, which will wrap the actual dialog content panel. GWT FocusPanel implements Focusable interface and allows registering click and key events. Proposed solution: 1. When revealing AbstractModelBoundPopupPresenterWidget, onReveal() calls getView().focus(), which will in turn delegate to FocusPanel.setFocus(true). This also means that AbstractModelBoundPopupView subclasses will no longer need to implement focus() on their own -- the FocusPanel dialog content wrapper itself will be focused and ready for receiving key events. 2. Besides UiCommonEditorVisitor that registers KeyPressHandler on each input widget (editor), FocusPanel will also have a KeyPressHandler registered that will do the exact same thing as KeyPressHandler in UiCommonEditorVisitor. This means: ENTER = find a default command and execute it, ESC = find a cancel command and execute it, for the given Dialog model. The possible downside here is that when the dialog FocusPanel looses its focus (e.g. user clicks away or presses TAB etc.), it will no longer receive key events. Fallback solution might be adding DOM key event handler on root <body> element, like this: // before dialog view is shown reg = RootLayoutPanel.get().addDomHandler(myHandler, KeyDownEvent.getType()); // before dialog view is hidden reg.removeHandler(); For "popup-over-popup" scenarios (e.g. Adding new host with dialog, and extra confirm dialog pops up asking about power management stuff), the <body> key handler solution might be problematic. Going to try the FocusPanel approach first. Found a solution that works even when there is nothing focused within the dialog, will send a patch soon. *** Bug 749171 has been marked as a duplicate of this bug. *** closing ON_QA bugs as oVirt 3.1 was released: http://www.ovirt.org/get-ovirt/ |