diff --git a/addons/website_form/static/src/snippets/s_website_form/options.js b/addons/website_form/static/src/snippets/s_website_form/options.js index b6df25dc588..e04cd492181 100644 --- a/addons/website_form/static/src/snippets/s_website_form/options.js +++ b/addons/website_form/static/src/snippets/s_website_form/options.js @@ -821,8 +821,8 @@ options.registry.WebsiteFieldEditor = FieldEditor.extend({ if (!value) { return; } - const name = this.el.querySelector(`[data-custom-field="${value}"]`).textContent; - const field = this._getCustomField(value, `Custom ${name}`); + const oldLabelText = this.$target[0].querySelector('.s_website_form_label_content').textContent; + const field = this._getCustomField(value, oldLabelText); this._setActiveProperties(field); await this._replaceField(field); this.rerender = true;