Skip to content

Commit 160d8be

Browse files
committed
[FIX] website: fix unable to enter edit mode on old browsers
Since commit [1], we added a selector using the ":has" pseudo-class in the template that defines where "inner content" blocks can be dropped. It is no longer possible to enter edit mode (a traceback occurs) starting from Odoo version 18.0 and in browsers older than Chrome 112 or Firefox 121. This bug happens because the same selector, used by jQuery, combines both the ":has" pseudo-class and the ":is" pseudo-class (this ":is" pseudo-class was introduced into the same selector by commit [2] starting from Odoo version 18.0). This is not compatible with the older browsers mentioned above. The bug only appears in version 18. However, we already fixed this in 16.0 in case potential customizations had added the ":is" pseudo-class to the same selector. [1]: odoo@65a8500 [2]: odoo@e0fc837 opw-4494945 closes odoo#195095 X-original-commit: 9360142 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
1 parent a6ba3d1 commit 160d8be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/website/static/src/js/editor/snippets.editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ export class WebsiteSnippetsMenu extends weSnippetEditor.SnippetsMenu {
242242
// TODO remove in master and adapt XML.
243243
const contentAdditionEl = html.querySelector("#so_content_addition");
244244
if (contentAdditionEl) {
245-
// Allows dropping "inner blocks" next to an image link.
246-
contentAdditionEl.dataset.dropNear += ", div:not(.o_grid_item_image) > a:has(img)";
245+
// Necessary to be able to drop "inner blocks" next to an image link.
246+
contentAdditionEl.dataset.dropNear += ", div:not(.o_grid_item_image) > a";
247247
}
248248

249249
const toFind = $html.find("we-fontfamilypicker[data-variable]").toArray();

0 commit comments

Comments
 (0)