From 5a2f7a46cfbcdfd4924dc726e01998ca0c61ccc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Mottet=20=28oms=29?= Date: Fri, 23 Apr 2021 13:49:46 +0000 Subject: [PATCH] [FIX] website: remove outerText and fix design flaw in configurator - outerText is a non-standard feature. It is not supported by firefox and should not be used. This commit replaced it by value. - The design of the industry selection screen had a misalignment flaw on firefox. This commit fixed it. - The industry selection used a element instead of an . closes odoo/odoo#70694 X-original-commit: 2dbbb4e38d603cbb5956fa61040a9497f60c3349 Signed-off-by: Quentin Smetz (qsm) Co-authored-by: Stefano Rigano --- .../components/configurator/configurator.js | 8 +-- .../components/configurator/configurator.xml | 14 ++--- .../website/static/src/scss/configurator.scss | 51 +++++++++++++------ 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/addons/website/static/src/components/configurator/configurator.js b/addons/website/static/src/components/configurator/configurator.js index 61ad1a36c05..6eaeccb491a 100644 --- a/addons/website/static/src/components/configurator/configurator.js +++ b/addons/website/static/src/components/configurator/configurator.js @@ -128,22 +128,24 @@ class DescriptionScreen extends Component { } selectIndustry(_, ui) { + this.industrySelection.el.parentNode.dataset.value = ui.item.label; this.dispatch('selectIndustry', this.labelToId[ui.item.label]); this.checkDescriptionCompletion(); } blurIndustrySelection(ev) { - const id = this.labelToId[ev.target.outerText]; + const id = this.labelToId[ev.target.value]; this.dispatch('selectIndustry', id); if (id === undefined) { - this.industrySelection.el.textContent = ''; + this.industrySelection.el.value = ''; + this.industrySelection.el.parentNode.dataset.value = ''; } else { this.checkDescriptionCompletion(); } } inputIndustrySelection(ev) { - this.dispatch('selectIndustry', this.labelToId[ev.target.outerText]); + this.industrySelection.el.parentNode.dataset.value = ev.target.value; } selectWebsiteType(ev) { diff --git a/addons/website/static/src/components/configurator/configurator.xml b/addons/website/static/src/components/configurator/configurator.xml index 872ded4f07a..33d414f2250 100644 --- a/addons/website/static/src/components/configurator/configurator.xml +++ b/addons/website/static/src/components/configurator/configurator.xml @@ -44,7 +44,7 @@ - - for my + for my - -