[FIX] web_editor: prevent traceback on remove flex styles

A traceback was triggered when removing flex styles in convert_inline.
This is fixed by iterating over the styles rather that over all keys of
the style object.

task-2697159

closes odoo/odoo#81540

X-original-commit: 18db94d9fc320c35e811d991fc4a32533d481083
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Antoine Guenet
2021-12-16 15:58:25 +00:00
parent 8b1012a79d
commit 1f9f7a13d4
@@ -284,7 +284,7 @@ function classToStyle($editable, cssRules) {
const $target = $(node);
const css = _getMatchedCSSRules(node, cssRules);
// Flexbox
for (const styleName in node.style) {
for (const styleName of node.style) {
if (styleName.includes('flex') || `${node.style[styleName]}`.includes('flex')) {
node.style[styleName] = '';
}