summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-10-08 13:32:59 +0300
committerVaadin Code Review <review@vaadin.com>2015-10-08 12:16:49 +0000
commit025f3b2b2581c64b86b93cda26305eaa7fffc8cc (patch)
treec0c0e5f50dd145070a4694ab6c2019fedbf493f9 /client
parent181b010139a5626e0e90cfcf9bfc1aa3710b18dd (diff)
downloadvaadin-framework-025f3b2b2581c64b86b93cda26305eaa7fffc8cc.tar.gz
vaadin-framework-025f3b2b2581c64b86b93cda26305eaa7fffc8cc.zip
Fix Checkbox event handling in Grid Editor (#19096)
This patch limits event preventDefault calls to happen only with Tab navigation. No other events are prevented by default anymore. Earlier implementation that prevented too many events was in patch for #16841 Change-Id: I78924d35c86b822295fdaf720b3e4540c43df5c0
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java b/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
index 5089f2f15c..0fea7c37bd 100644
--- a/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
+++ b/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
@@ -154,6 +154,8 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
rowDelta = (e.getShiftKey() ? -1 : +1);
} else if (e.getKeyCode() == KEYCODE_MOVE_HORIZONTAL) {
colDelta = (e.getShiftKey() ? -1 : +1);
+ // Prevent tab out of Grid Editor
+ event.getDomEvent().preventDefault();
}
final boolean changed = rowDelta != 0 || colDelta != 0;
@@ -201,10 +203,10 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
*/
protected boolean handleBufferedMoveEvent(EditorDomEvent<T> event) {
Event e = event.getDomEvent();
- final EventCellReference<T> cell = event.getCell();
if (e.getType().equals(BrowserEvents.CLICK)
&& event.getRowIndex() == event.getCell().getRowIndex()) {
+
editRow(event, event.getRowIndex(), event.getCell()
.getColumnIndexDOM());
@@ -213,6 +215,9 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
} else if (e.getType().equals(BrowserEvents.KEYDOWN)
&& e.getKeyCode() == KEYCODE_MOVE_HORIZONTAL) {
+ // Prevent tab out of Grid Editor
+ event.getDomEvent().preventDefault();
+
editRow(event, event.getRowIndex(), event.getFocusedColumnIndex()
+ (e.getShiftKey() ? -1 : +1));
@@ -306,11 +311,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
&& handleOpenEvent(event);
}
- if (handled) {
- // Prevent any defaults for handled events.
- event.getDomEvent().preventDefault();
- }
-
// Buffered mode should swallow all events, if not already handled.
boolean swallowEvent = event.getGrid().isEditorActive()
&& editor.isBuffered();