Fix selected check boxes

This commit is contained in:
Sipke Schoorstra 2021-04-15 18:59:33 +02:00
parent a084fa4bf4
commit 5d4f78dac5

View file

@ -53,10 +53,10 @@ export class ElsaCheckListProperty {
<div class="max-w-lg space-y-3 my-4">
{options.map((option, index) => {
const inputId = `${fieldId}_${index}`;
const isSelected = values.findIndex(x => x == option) >= 0;
const optionIsString = typeof(option) == 'string';
const value = optionIsString ? option : option.value;
const text = optionIsString ? option : option.text;
const isSelected = values.findIndex(x => x == value) >= 0;
return (
<div class="relative flex items-start">