Disable dp.change event when setting date value

DateTimePicker trigger the event when the date value is set which trigger the
focus_out. When this happens during the display of a Dict widget, the keys not
yet displayed are lost.

issue7361
review47331003
This commit is contained in:
Cédric Krier committed 2018-04-20 12:48:36 +02:00
1 parent baf255656c
commit a9dd3203b0
1 file changed
+13 -2
+13 -2
View File
@@ -1524,7 +1524,12 @@ function eval_pyson(value){
} else {
value = null;
}
this.date.data('DateTimePicker').date(value);
this.date.off('dp.change');
try {
this.date.data('DateTimePicker').date(value);
} finally {
this.date.on('dp.change', this.focus_out.bind(this));
}
},
focus: function() {
this.input.focus();
@@ -4413,7 +4418,13 @@ function eval_pyson(value){
return value;
},
set_value: function(value) {
this.date.data('DateTimePicker').date(value);
this.date.off('dp.change');
try {
this.date.data('DateTimePicker').date(value);
} finally {
this.date.on('dp.change',
this.parent_widget.focus_out.bind(this.parent_widget));
}
}
});