From e2930e19a025fff05069fbfb0c5b18eb75e0d56a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 27 Aug 2015 08:32:31 +0200 Subject: [PATCH] [FIX] web: glitch with scroll and list editable On a first edition of a view list editable, scrolling before the first edition might cause an issue: the editing fields are higher than they should. This commit solves this. This issue stems from jQuery .offset({value}) function which is broken if the element we want to position: - is in absolute postionning, - is inside a scrolled element in non static positionning, - has not both top and left css property setted, - has no ancestor element between itself and the scrolled not in static positionning. This issue happens less (and probably not at all) in saas-6 since the last condition is most often not met thanks to this change: https://github.com/odoo/odoo/commit/1ccd87a#diff-27c072074221456684bfc5f150ca0bc9R876 This issue of jquery is solved since jquery 3.0.0-alpha1: https://github.com/jquery/jquery/commit/2d71594 ( the issue is shown in https://jsfiddle.net/wpjrnggf/ and we can see it is solved with jQuery 3.0.0-alpha1 https://jsfiddle.net/L6ykpjgy/ ) closes #8251 opw-647622 --- addons/web/static/src/js/view_list_editable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index a0a2010d5cc..8c3f7d09ada 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -301,7 +301,7 @@ var $cell = $(cell); field.set_dimensions($cell.outerHeight(), $cell.outerWidth()); - field.$el.position({ + field.$el.css({top: 0, left: 0}).position({ my: 'left top', at: 'left top', of: $cell