Closed marko1010 closed 8 months ago
On initial page load the selected options appear correctly in the UI but inside the generated <select> element only one option has the selected attribute set to true
<select>
selected
true
<Svelecte multiple={true} collapseSelection="always" clearable={true} keepSelectionInList={true} searchProps={{ skipSort: true }} options={provinces} value={data.provinces} name="provinces[]" ></Svelecte>
I have to use this as a workaround when submitting form:
document.addEventListener('submit', function(event) { document.querySelectorAll('form select.sv-hidden-element option').forEach(x => x.selected = true) }, true);
This was reported before, but due the lack of user input I wasn't sure it's still present. Related issue: #168
In general it is related to unfixed svelte bug.
On initial page load the selected options appear correctly in the UI but inside the generated
<select>
element only one option has theselected
attribute set totrue
I have to use this as a workaround when submitting form: