render blank option checkbox
This commit is contained in:
@@ -18,7 +18,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<% elsif field['type'].in?(%w[multiple radio]) && area['option_uuid'] %>
|
<% elsif field['type'].in?(%w[multiple radio]) && area['option_uuid'] %>
|
||||||
<% option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] } %>
|
<% option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] } %>
|
||||||
<% if option && Array.wrap(value).include?(option['value']) %>
|
<% option_name = option['value'].presence || "Option #{field['options'].index(option) + 1}" %>
|
||||||
|
<% if option && Array.wrap(value).include?(option_name) %>
|
||||||
<div class="w-full flex items-center justify-center">
|
<div class="w-full flex items-center justify-center">
|
||||||
<%= svg_icon('check', class: "aspect-square #{area['w'] > area['h'] ? '!w-auto !h-full' : '!w-full !h-auto'}") %>
|
<%= svg_icon('check', class: "aspect-square #{area['w'] > area['h'] ? '!w-auto !h-full' : '!w-full !h-auto'}") %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -159,7 +159,9 @@ module Submissions
|
|||||||
if field['type'].in?(%w[multiple radio])
|
if field['type'].in?(%w[multiple radio])
|
||||||
option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] }
|
option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] }
|
||||||
|
|
||||||
value = Array.wrap(value).include?(option['value'])
|
option_name = option['value'].presence || "Option #{field['options'].index(option) + 1}"
|
||||||
|
|
||||||
|
value = Array.wrap(value).include?(option_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
next unless value == true
|
next unless value == true
|
||||||
|
|||||||
Reference in New Issue
Block a user