changeset d8401a59de64 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=d8401a59de64
description:
Set focus on the form if it does not have it
When set_cursor is called, it should force to set the focus on the first
focusable widget of the form.
issue8604
review258011002
diffstat:
src/view/form.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r 518497a4ae43 -r d8401a59de64 src/view/form.js
--- a/src/view/form.js Mon Sep 02 18:31:43 2019 +0200
+++ b/src/view/form.js Mon Sep 02 18:33:18 2019 +0200
@@ -345,8 +345,8 @@
var widgets, error_el, pages, is_ancestor;
var currently_focused = jQuery(document.activeElement);
- var has_focus = currently_focused.closest(this.el) > 0;
- if (reset_view || has_focus) {
+ var has_focus = currently_focused.closest(this.el).length > 0;
+ if (reset_view || !has_focus) {
if (reset_view) {
for (i = 0; i < this.notebooks.length; i++) {
notebook = this.notebooks[i];