summaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-08-18 15:39:44 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-18 15:39:44 +0300
commit554f39ad0455623fbb1befc4444e67c809de5c0a (patch)
tree96ba4702a3ee82031808c15386c530e51f08e0b2 /client/src
parentc46678460325f399c75cd8f00ceb230625524f10 (diff)
downloadvaadin-framework-554f39ad0455623fbb1befc4444e67c809de5c0a.tar.gz
vaadin-framework-554f39ad0455623fbb1befc4444e67c809de5c0a.zip
Fix focus when Grid editor is saved or cancelled (#9835)
Fixes #9832
Diffstat (limited to 'client/src')
-rw-r--r--client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java1
-rwxr-xr-xclient/src/main/java/com/vaadin/client/widgets/Grid.java15
2 files changed, 10 insertions, 6 deletions
diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
index 8a6a5e59e2..b7059c035f 100644
--- a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
+++ b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java
@@ -230,6 +230,7 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> {
// Save and close.
event.getGrid().getEditor().save();
+ FocusUtil.setFocus(event.getGrid(), true);
return true;
}
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java
index 9f70a63f5e..267dbccc87 100755
--- a/client/src/main/java/com/vaadin/client/widgets/Grid.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java
@@ -1468,6 +1468,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
@Override
public void onClick(ClickEvent event) {
save();
+ FocusUtil.setFocus(grid, true);
}
});
@@ -1477,6 +1478,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
@Override
public void onClick(ClickEvent event) {
cancel();
+ FocusUtil.setFocus(grid, true);
}
});
}
@@ -7665,12 +7667,13 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
event.getDomEvent().stopPropagation();
// fixes https://github.com/vaadin/framework/issues/8632
- // don't mark the event as handled, in order for the next handler
- // in the handler chain (HeaderDefaultRowEventHandler) to be able to
- // receive it. This should be safe since the next handlers in the
- // chain (RendererEventHandler and CellFocusEventHandler) do not
- // react to header touches/clicks.
-// event.setHandled(true);
+ // don't mark the event as handled, in order for the next
+ // handler in the handler chain (HeaderDefaultRowEventHandler)
+ // to be able to receive it. This should be safe since the next
+ // handlers in the chain (RendererEventHandler and
+ // CellFocusEventHandler) do not react to header touches/clicks.
+
+ // event.setHandled(true);
}
}
};