Skip to content

Commit 0685798

Browse files
committed
Fix custom survey question bug
1 parent 9c5d1a8 commit 0685798

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
<%= answer_form.text_field :body, label: false, id: field_id, disabled: disabled, maxlength: maxlength, required: false %>
1+
<%# <%= answer_form.text_field :body, label: false, id: field_id, disabled: disabled, maxlength: maxlength, required: false %> %>
2+
3+
<div>
4+
<%= answer_form.text_field :body, label: false, id: field_id, disabled:, maxlength:, class: "w-full" %>
5+
</div>

app/views/decidim/forms/questionnaires/answers/_single_option.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
<% custom.radio_button_options.each do |answer_option, idx| %>
1717
<% choice_id = "#{field_id}_choices_#{idx}" %>
1818

19-
<div class="collection-input">
19+
<div class="js-collection-input">
2020
<%= label_tag "#{choice_id}_body" do %>
21+
2122
<%= radio_button_tag "questionnaire[responses][#{answer_idx}][choices][][body]",
2223
translated_attribute(answer_option.body),
2324
answer_option.id == custom.selected_option,
@@ -29,14 +30,14 @@
2930
<%= hidden_field_tag "questionnaire[responses][#{answer_idx}][choices][][answer_option_id]",
3031
answer_option.id,
3132
id: "#{choice_id}_answer_option",
32-
disabled: %>
33+
disabled: true %>
3334
<% end %>
3435

3536
<% if answer_option.free_text %>
3637
<%= text_field_tag "questionnaire[responses][#{answer_idx}][choices][][custom_body]",
3738
choice.try(:custom_body),
3839
id: "#{choice_id}_custom_body",
39-
disabled:,
40+
disabled: true,
4041
maxlength:,
4142
class: "w-full" %>
4243
<% end %>

0 commit comments

Comments
 (0)