bootstrap-select icon indicating copy to clipboard operation
bootstrap-select copied to clipboard

Not able to "refresh"

Open kapdom opened this issue 3 years ago • 4 comments

Hi. If I add attribute "selected" to one of the option on the server side then I'm not able to reset selected value.

<select name="shop_id" class="my-select" data-width="100%" data-size="5" data-live-search="true" title="Select"> @foreach(shops() as $row) <option value="{{$row->id}}" @if($row->id == $shop_id) selected @endif>{{$row->name}}</option> @endforeach </select> How to reset it if one of the option had selected attribute?

kapdom avatar Sep 09 '21 09:09 kapdom

Hello,

I don't think it has anything to do with the fact that the selected attribute is added server side. What do you mean by "reset the selected value"?

NicolasCARPi avatar Sep 09 '21 12:09 NicolasCARPi

I mean this "$(citySelect).selectpicker('refresh');"

kapdom avatar Sep 09 '21 12:09 kapdom

Can you confirm that if you don't have any element with the selected attribute, the refresh works?

NicolasCARPi avatar Sep 09 '21 14:09 NicolasCARPi

If I don't add selected attribute then works, perfectly.

kapdom avatar Sep 10 '21 04:09 kapdom