Skip to content
Snippets Groups Projects
Commit fd778ce3 authored by Antoine Guenet's avatar Antoine Guenet
Browse files

[FIX] web_editor: ensure no sibling tables for Firefox

Firefox doesn't seem to do well with sibling tables, so we need to
wrap them each in separate rows.

This is a backport of commit [1] from 16.0.

[1]: https://github.com/odoo/odoo/commit/3759a83773ac7a3d7ff004cbe54823ab90c56b64

Part-of: odoo/odoo#125146
parent 10b5a42a
Branches
Tags
No related merge requests found
......@@ -286,6 +286,16 @@ function bootstrapToTable($editable) {
}
tr.remove(); // row was cloned and inserted already
}
// Merge tables in tds into one common table, each in its own row.
const tds = [...editable.querySelectorAll('td')]
.filter(td => td.children.length > 1 && [...td.children].every(child => child.nodeName === 'TABLE'))
.reverse();
for (const td of tds) {
const table = _createTable();
const trs = [...td.children].map(child => _wrap(child, 'td')).map(wrappedChild => _wrap(wrappedChild, 'tr'));
trs[0].before(table);
table.append(...trs);
}
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment