[FIX] web: column resize trying to freeze the list

Before this commit, resizing a column would cause the
list to develop a mind of its own and to grow/shrink random
columns according to its own will.

Now, resizing a column does not "freeze" the list anymore and simply
gives a static width to the resized column.
This commit is contained in:
Julien Mougenot
2019-09-25 06:16:54 +00:00
committed by Aaron Bohy
parent d2f024d254
commit d99e80f92a
2 changed files with 1 additions and 20 deletions
@@ -1534,8 +1534,6 @@ ListRenderer.include({
const table = this.el.getElementsByTagName('table')[0];
const th = ev.target.closest('th');
// Freeze the whole table width
this._freezeColumnWidths();
table.style.width = `${table.offsetWidth}px`;
const thPosition = [...th.parentNode.children].indexOf(th);
const resizingColumnElements = [...table.getElementsByTagName('tr')]
+1 -18
View File
@@ -1637,7 +1637,7 @@ QUnit.module('Views', {
});
QUnit.test('editable list: list view in an initially unselected notebook page', async function (assert) {
assert.expect(9);
assert.expect(8);
this.data.foo.records = [{ id: 1, o2m: [1] }];
this.data.bar = {
@@ -1746,23 +1746,6 @@ QUnit.module('Views', {
"list has been correctly frozen after sorting a column");
form.destroy();
// Case 5: resize a column
form = await createView(formOptions);
await testUtils.dom.click(form.$('.nav-item:last-child .nav-link'));
const resizeHandle = form.$('.o_resize')[0];
await testUtils.dom.dragAndDrop(resizeHandle, resizeHandle, {
mousemoveTarget: window,
mouseupTarget: window,
});
[titi, grosminet] = form.$('th');
assert.ok(
titi.style.width.split('px')[0] > 80 &&
grosminet.style.width.split('px')[0] > 700,
"list has been correctly frozen after resizing a column");
form.destroy();
});
QUnit.test('editable list: list view hidden by an invisible modifier', async function (assert) {