From c93be09f2e193dfee8a5d6debd80d5d83de55692 Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Tue, 14 Feb 2017 15:10:01 +0100 Subject: [PATCH] [FIX] web: caret misplaced Due to the library algorithm to place the datetimepicker, the div containing the input was no longer relative so the caret was misplaced. Put back the position relative and place the datetimepicker relative to the input. --- addons/web/static/src/js/widgets/date_picker.js | 4 ++-- addons/web/static/src/less/datepicker.less | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js index 20171e554a2..bd9416a278a 100644 --- a/addons/web/static/src/js/widgets/date_picker.js +++ b/addons/web/static/src/js/widgets/date_picker.js @@ -46,8 +46,8 @@ var DateWidget = Widget.extend({ this.$input.focus(function(e) { e.stopImmediatePropagation(); }); - this.$el.datetimepicker(this.options); - this.picker = this.$el.data('DateTimePicker'); + this.$input.datetimepicker(this.options); + this.picker = this.$input.data('DateTimePicker'); this.$input.click(this.picker.toggle.bind(this.picker)); this.set_readonly(false); this.set_value(false); diff --git a/addons/web/static/src/less/datepicker.less b/addons/web/static/src/less/datepicker.less index a1ecab3fdc2..bc36f8c5a43 100644 --- a/addons/web/static/src/less/datepicker.less +++ b/addons/web/static/src/less/datepicker.less @@ -13,6 +13,8 @@ } .o_datepicker { + position: relative; + .o_datepicker_input { width: 100%; }