Is there a way to filter options based on user input in Select2, especially when I need to get the first symbols entered by the user? I have tried using the @select event but it doesn't seem suitable for this task. How can I achieve this?
<Select2
value="modelValue"
@input="(e) => modelValue = e.target.value"
:settings="select2Settings"
/>
select2Settings: {
sorter: function (results) {
return results.filter((item) => item.text.startsWith(modelValue))
}
}
I also attempted to use the @change event but it was unsuccessful. You can see an example of this issue in this demo.