From 1977acbda94af689d0bfc5925370cfab0dded002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 28 Oct 2022 00:41:34 +0200 Subject: [PATCH] Do not set focus on date when input changed for Firefox Firefox fires a change event when user use the navigation per month and year. So we can not set the focus on the date entry without closing the input picker. In order to navigate with tab after picker is closed, we must ensure to not have the focus on the icon. issue11715 review426031003 --- src/view/form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/form.js b/src/view/form.js index b177c851b8..0b33ff6782 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1691,7 +1691,10 @@ function eval_pyson(value){ value = this._parse(this._input_format, value); value = this._format(this.get_format(), value); this.date.val(value).change(); - this.date.focus(); + if (!~navigator.userAgent.indexOf("Firefox")) { + // Firefox triggers change when navigate by month/year + this.date.focus(); + } } this.send_modified(); }); @@ -1700,6 +1703,7 @@ function eval_pyson(value){ 'class': 'icon-input icon-secondary', 'aria-label': Sao.i18n.gettext("Open the calendar"), 'title': Sao.i18n.gettext("Open the calendar"), + 'tabindex': -1, }).appendTo(group); this.input.appendTo(this.icon); Sao.common.ICONFACTORY.get_icon_img('tryton-date')