From 35535ce1129e4844f952d9d6cf5f75bc6a2da63f Mon Sep 17 00:00:00 2001 From: Ethan Vincent Date: Fri, 23 Feb 2024 12:00:06 +0100 Subject: [PATCH] [FIX] survey: show comment as answer text area **Current behavior:** A survey question which has a comment field counted as an answer will not reveal its text box input field when it is selected as the current answer. **Expected behavior:** After clicking on the comment field answer, the text box will be revealed and enabled. **Steps to reproduce:** 1. In the surveys app, add a question to a survey of type `Multiple choice: only one answer` 2. In the question's options, enable the `Show Comments Field` and `Comment is an answer` options 3. Go to the question in the survey, click on the comment answer and observe there is no field to enter a comment **Cause of the issue:** The function which is responsible for adapting these page elements is not selecting the correct html elements, thus their attributes are not properly changed when needed. **Fix:** Change the function variables so that they are pointing to the correct location in the DOM. opw-3748291 closes odoo/odoo#155023 Signed-off-by: Thibault Delavallee (tde) --- addons/survey/static/src/js/survey_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/static/src/js/survey_form.js b/addons/survey/static/src/js/survey_form.js index 5aadd59b6b0..6d3d0aaeedd 100644 --- a/addons/survey/static/src/js/survey_form.js +++ b/addons/survey/static/src/js/survey_form.js @@ -165,7 +165,7 @@ publicWidget.registry.SurveyFormWidget = publicWidget.Widget.extend(SurveyPreloa const $target = $(event.currentTarget); const $choiceItemGroup = $target.closest('.o_survey_form_choice'); - this._applyCommentAreaVisibility($target); + this._applyCommentAreaVisibility($choiceItemGroup); const isQuestionComplete = this._checkConditionalQuestionsConfiguration($target, $choiceItemGroup); if (isQuestionComplete && this.options.usersCanGoBack) { const isLastQuestion = this.$('button[value="finish"]').length !== 0;