[FIX] web: fix date picker fields do not capture the focus event when invisible

Before this fix, in form view, when a datepicker was not visible (because
they were on another page or literally invisible), when the user pressed
TAB and the datepicker was positionned after the current field in the
form, it was capturing the focus during the activate phase of the
navigation_move.
This is not correct for invisible elements.

After this fix, only focusable datepickers get the focus during the
activation phase of the navigation_move.

co-author: aab-odoo (aab@odoo.com)
This commit is contained in:
Vincent Schippefilt
2018-09-26 11:43:38 +02:00
parent 046837b9a1
commit c2b4790be4
2 changed files with 35 additions and 10 deletions
@@ -538,7 +538,7 @@ var FieldDate = InputField.extend({
* @override
*/
activate: function () {
if (this.datewidget) {
if (this.isFocusable() && this.datewidget) {
this.datewidget.focus();
return true;
}