From 3f147cbfa04ad596a10a211baad8f958e47959ee Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 9 Mar 2017 14:50:45 +0100 Subject: [PATCH] [FIX] web: list editable: no flicker when editing The test checking that the cells width remains the same when entering the edition mode was broken, because we didn't hardcode the width for readonly cells. This commit ensures that we force the width of all the cells of the edited row. --- .../static/src/js/views/list/list_editable_renderer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js index 38b3066a4d3..b486f6f592c 100644 --- a/addons/web/static/src/js/views/list/list_editable_renderer.js +++ b/addons/web/static/src/js/views/list/list_editable_renderer.js @@ -263,10 +263,6 @@ ListRenderer.include({ return; } var $td = this._findTd($row, colIndex); - // force the width of the cell to its current value so that it won't - // change if its content changes (to prevent the list view from - // flickering). - $td.width($td.width()); var widget_keys = ['list.' + field.type, field.type]; if (node.attrs.widget) { widget_keys.unshift(node.attrs.widget); @@ -385,6 +381,12 @@ ListRenderer.include({ // instantiate column widgets var $row = this.$('tbody tr').eq(rowIndex); $row.addClass('o_selected_row'); + // force the width of each cell to its current value so that it won't + // change if its content changes, to prevent the view from flickering + $row.find('td').each(function () { + var $td = $(this); + $td.width($td.width()); + }); _.each(this.columns, function (node, index) { var widget = self._renderFieldWidget($row, node, rowIndex, index);