fix(dropdown-multiple): a valid option starting by [ may not be a JSON value
This commit is contained in:
parent
da19ba5fe4
commit
560d50f52d
2 changed files with 4 additions and 2 deletions
|
@ -90,7 +90,7 @@ class Champs::MultipleDropDownListChamp < Champ
|
|||
values = if value.is_a?(Array)
|
||||
value
|
||||
elsif value.starts_with?('[')
|
||||
JSON.parse(value)
|
||||
JSON.parse(value) rescue selected_options + [value] # value may start by [ without being a real JSON value
|
||||
else
|
||||
selected_options + [value]
|
||||
end.uniq.without('')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue