diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index b413275fbbb..f7c387db807 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -752,7 +752,7 @@ export class OdooEditor extends EventTarget { } const fontSizeInput = this.toolbar.querySelector('input#fontSizeCurrentValue'); this.addDomListener(this.toolbar, 'click', ev => { - if (fontSizeInput && ev.target.closest('#font-size .dropdown-toggle')) { + if (fontSizeInput && !fontSizeInput.readOnly && ev.target.closest('#font-size .dropdown-toggle')) { // If the click opened the font size dropdown, select the input content. fontSizeInput.select(); } else if (!this.isSelectionInEditable()) { diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js index 8326dec3f68..b549009e37e 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js @@ -1867,8 +1867,8 @@ export function getFontSizeDisplayValue(sel, getCSSVariableValue, convertNumeric `); let remValue; if (closestFontSizedEl) { - const customFontSize = closestFontSizedEl.style.fontSize; - if (customFontSize) { + const useFontSizeInput = closestFontSizedEl.style.fontSize; + if (useFontSizeInput) { // Use the computed value to always convert to px. However, this // currently does not check that the inline font-size is the one // actually having an effect (there could be an !important CSS rule diff --git a/addons/web_editor/static/src/js/editor/toolbar.js b/addons/web_editor/static/src/js/editor/toolbar.js index 4f32785d34c..de4f4385dca 100644 --- a/addons/web_editor/static/src/js/editor/toolbar.js +++ b/addons/web_editor/static/src/js/editor/toolbar.js @@ -18,6 +18,7 @@ export class Toolbar extends Component { showChecklist: { type: Boolean, optional: true }, showColors: { type: Boolean, optional: true }, showFontSize: { type: Boolean, optional: true }, + useFontSizeInput: { type: Boolean, optional: true }, showHistory: { type: Boolean, optional: true }, showStyle: { type: Boolean, optional: true }, @@ -50,6 +51,7 @@ export class Toolbar extends Component { showChecklist: true, showColors: true, showFontSize: true, + useFontSizeInput: false, showHistory: false, showStyle: true, diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index b20a5cbef58..6f7f60b1eff 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -91,12 +91,12 @@ -
+