From 3a488d59d4bd97f8950e9b7ac0e138e77476d447 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 3 Oct 2022 11:10:28 +0000 Subject: [PATCH] [FIX] web_editor, website: restore style of the autocomplete dropdown Before this commit, the autocomplete dropdown no longer had a maximum height, which meant that when it contained a lot of elements, it hid the entire editor panel. Indeed, since the CSS of the menu snippet is no longer that of the "frontend", the 'max-height' CSS rule defined for the autocomplete dropdown in the frontend (introduced by this commit: [1]) was no longer applied on the autocomplete dropdown of the backend. In this commit, we therefore moved this css code of the 'ui-autocomplete' defined for the frontend into the common css file (backend + frontend) in order to return to a situation where this code was applied to all autocomplete dropdowns in Website. And thanks to that, we were able to remove the css file "edit_menu.scss" which copied/pasted the frontend 'ui-autocomplete' code for only one of the backend 'ui-autocomplete'. [1]: https://github.com/odoo/odoo/commit/032dd007157de00b683a9d753aa929741c107c01 task-2900529 closes odoo/odoo#102719 X-original-commit: cce26d7697c73326e0a6f2ec81e01b56b4156ad4 Signed-off-by: Romain Derie (rde) --- .../static/src/scss/web_editor.common.scss | 22 +++++++++++++++++++ .../static/src/scss/web_editor.frontend.scss | 14 ------------ .../src/components/dialog/edit_menu.scss | 16 -------------- 3 files changed, 22 insertions(+), 30 deletions(-) delete mode 100644 addons/website/static/src/components/dialog/edit_menu.scss diff --git a/addons/web_editor/static/src/scss/web_editor.common.scss b/addons/web_editor/static/src/scss/web_editor.common.scss index c7f3af43022..e53b9bc92ab 100644 --- a/addons/web_editor/static/src/scss/web_editor.common.scss +++ b/addons/web_editor/static/src/scss/web_editor.common.scss @@ -1002,3 +1002,25 @@ section, .oe_img_bg, [data-oe-shape-data] { } } } + +// Autocomplete dropdowns +.ui-autocomplete { + max-height: 50vh; + overflow-y: auto; + overflow-x: hidden; + + .ui-menu-item { + padding: 0; + > .ui-state-active { + border: none; + font-weight: normal; + margin: 0; + } + } + .fw-bold { + // Needed because the font-family is not "system fonts everywhere" as + // elements around it. TODO: use "system fonts everywhere" for + // the 'ui-autocomplete' and remove this line. + font-weight: 700 !important; + } +} diff --git a/addons/web_editor/static/src/scss/web_editor.frontend.scss b/addons/web_editor/static/src/scss/web_editor.frontend.scss index c1ec4ed7908..6470da92f9a 100644 --- a/addons/web_editor/static/src/scss/web_editor.frontend.scss +++ b/addons/web_editor/static/src/scss/web_editor.frontend.scss @@ -15,20 +15,6 @@ transform: translate(-50%, -50%) } -.ui-autocomplete { - max-height: 50vh; - overflow-y: auto; - overflow-x: hidden; - - .ui-menu-item { - padding: 0; - > .ui-state-active { - border: none; - font-weight: normal; - margin: 0; - } - } -} @include media-breakpoint-down(md) { .o_we_shape { display: none; diff --git a/addons/website/static/src/components/dialog/edit_menu.scss b/addons/website/static/src/components/dialog/edit_menu.scss deleted file mode 100644 index 3af9717484f..00000000000 --- a/addons/website/static/src/components/dialog/edit_menu.scss +++ /dev/null @@ -1,16 +0,0 @@ -.ui-autocomplete.o_edit_menu_autocomplete { - max-height: 50vh; - overflow-y: auto; - overflow-x: hidden; - .ui-menu-item { - padding: 0; - > .ui-state-active { - border: none; - font-weight: normal; - margin: 0; - } - } - .fw-bold { - font-weight: 700 !important; - } -}