changeset 584409d01e8b in sao:6.2
details: https://hg.tryton.org/sao?cmd=changeset&node=584409d01e8b
description:
        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
        (grafted from 229609bd10badedef59ac60b4e4dd6ed8764f288)
diffstat:

 src/view/form.js |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 2bdcc9a572fd -r 584409d01e8b src/view/form.js
--- a/src/view/form.js  Wed Oct 26 23:30:54 2022 +0200
+++ b/src/view/form.js  Fri Oct 28 00:41:34 2022 +0200
@@ -1676,7 +1676,10 @@
                     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();
+                    }
                 }
             }.bind(this));
             if (this.input[0].type == this._input) {
@@ -1684,6 +1687,7 @@
                     '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')

Reply via email to