Skip to content

Commit

Permalink
fix: tags field in select mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jan 21, 2025
1 parent 041d00f commit 8ffc0f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
disabled: disabled?,
placeholder: @field.placeholder,
style: @field.get_html(:style, view: view, element: :input),
value: @field.select_mode? ? @field.field_value.first : @field.field_value.to_json
value: @field.field_value.to_json
%>
<% end %>
2 changes: 1 addition & 1 deletion lib/avo/fields/tags_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def field_value
acts_as_taggable_on_values.map { |value| {value:} }.as_json
else
# Wrap the value on Array to ensure select mode compatibility
Array(value) || []
Array.wrap(value) || []
end
end

Expand Down

0 comments on commit 8ffc0f0

Please sign in to comment.