The select2 can contain even 10k-20k options. This is the code:
<select class="meds-single-select w-100" name="meds" id="meds">
@if( $items->count() )
@foreach ($items as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
I am getting the items from the database, obviously. What I want to do is to render only the first 20 options, and then render the next 20 options if I scroll down and so on. Found a thread here on stackoverflow but it doesn't apply to my code unfortunately