[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) <tde@openerp.com>
This commit is contained in:
Ethan Vincent
2024-03-05 12:46:14 +00:00
parent a8806fb6d4
commit 35535ce112
+1 -1
View File
@@ -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;