File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 jsReady: false,
2222 open: false,
2323 query: '',
24- selected: '{{ selected|default:'' }}',
24+ selected: '{{ selected|default:''|escapejs }}',
2525 selectedLabel: '',
2626 options: [],
2727 activeIndex: -1,
3535 this.jsReady = true;
3636 this.options = JSON.parse(document.getElementById('field-{{ name }}-options').textContent);
3737 if (this.selected) {
38- const match = this.options.find(o => o.value === this.selected);
38+ const match = this.options.find(o => String( o.value) === String( this.selected) );
3939 if (match) this.selectedLabel = match.label;
4040 }
4141 },
130130 < template x-for ="option in filtered " :key ="option.value ">
131131 < div class ="dropdown__item "
132132 :id ="'field-{{ name }}-option-' + option.value "
133- :class ="{ 'dropdown__item--selected': selected === option.value, 'dropdown__item--active': activeValue === option.value } "
133+ :class ="{ 'dropdown__item--selected': String( selected) === String( option.value) , 'dropdown__item--active': activeValue === option.value } "
134134 role ="option "
135- :aria-selected ="selected === option.value "
135+ :aria-selected ="String( selected) === String( option.value) "
136136 @click ="choose(option.value, option.label) "
137137 @keydown.enter.prevent ="choose(option.value, option.label) "
138138 @keydown.space.prevent ="choose(option.value, option.label) "
You can’t perform that action at this time.
0 commit comments