aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Pòˆntelin <teemu@vaadin.com>2014-03-20 00:15:45 +0200
committerVaadin Code Review <review@vaadin.com>2014-03-24 18:42:50 +0000
commit445e86c25a94a83ef1314f6c6e27d46dcb6780dc (patch)
tree732f0ff71158fcf2f8fbef8e3ba078dfd3eeb26b /client
parentd5ce54586a445550b3df5168fe83accb3945901e (diff)
downloadvaadin-framework-445e86c25a94a83ef1314f6c6e27d46dcb6780dc.tar.gz
vaadin-framework-445e86c25a94a83ef1314f6c6e27d46dcb6780dc.zip
Esc now closes the date popup even if focused on the time selectors (#12314)
Change-Id: I68bc7922074c8c03957fbffce8a3d453726e8c1a
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VCalendarPanel.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java
index d1a94ffb9a..c6832226a4 100644
--- a/client/src/com/vaadin/client/ui/VCalendarPanel.java
+++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java
@@ -1094,12 +1094,18 @@ public class VCalendarPanel extends FocusableFlexTable implements
* The keydown/keypress event
*/
private void handleKeyPress(DomEvent<?> event) {
+ // Special handling for events from time ListBoxes.
if (time != null
&& time.getElement().isOrHasChild(
(Node) event.getNativeEvent().getEventTarget().cast())) {
int nativeKeyCode = event.getNativeEvent().getKeyCode();
if (nativeKeyCode == getSelectKey()) {
- onSubmit(); // submit happens if enter key hit down on listboxes
+ onSubmit(); // submit if enter key hit down on listboxes
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ if (nativeKeyCode == getCloseKey()) {
+ onCancel(); // cancel if ESC key hit down on listboxes
event.preventDefault();
event.stopPropagation();
}