diff --git a/addons/web_editor/static/src/js/common/grid_layout_utils.js b/addons/web_editor/static/src/js/common/grid_layout_utils.js index ffa5da88b69..317895caaa1 100644 --- a/addons/web_editor/static/src/js/common/grid_layout_utils.js +++ b/addons/web_editor/static/src/js/common/grid_layout_utils.js @@ -326,8 +326,7 @@ export function _checkIfImageColumn(columnEl) { } /** * Removes the line breaks and textnodes of the column, adds the grid class and - * sets the image width to default so it can be displayed as expected. Also - * blocks the edition of the column. + * sets the image width to default so it can be displayed as expected. * * @private * @param {Element} columnEl a column containing only an image. 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 e2acea2f452..e8be112c676 100644 --- a/addons/web_editor/static/src/scss/web_editor.frontend.scss +++ b/addons/web_editor/static/src/scss/web_editor.frontend.scss @@ -99,8 +99,8 @@ // Needed when "a" is "display: block". > a { - width: 100% !important; - height: 100% !important; + width: 100%; + height: 100%; } } } diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 82f7df86978..fb7525e1154 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -4029,15 +4029,7 @@ options.registry.GridImage = options.Class.extend({ * @returns {?HTMLElement} */ _getImageGridItem() { - let parentEl = this.$target[0].parentNode; - if (parentEl.matches("a")) { - // Case of an image link. - parentEl = parentEl.parentNode; - } - if (parentEl && parentEl.classList.contains('o_grid_item_image')) { - return parentEl; - } - return null; + return this.$target[0].closest(".o_grid_item_image"); }, /** * @override