Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converting from boostrap-select: encountering several issues... #2088

Open
dss010101 opened this issue Mar 23, 2024 · 0 comments
Open

converting from boostrap-select: encountering several issues... #2088

dss010101 opened this issue Mar 23, 2024 · 0 comments

Comments

@dss010101
Copy link

I am attempting to convert to this library from bootstrap-select, but, I am running into several issues with this widget:

  1. closeAfterSelect does not seem to work
  2. nav keys do not work in the input area. when closed nothing happens. When opened, even though cursor is in input area, the nav keys navigate the dropped down list.
  3. Unable to select all or cut text in the input area (i.e. CTRL + A) does not work.
  4. should the control automatically select an option list where 'selected=true'?
  5. onChange seems to fire each time you type a character, as opposed to when the selection actually changes.

Below is the version and how im populating the base html elements (note i am setting a 'Selected' attribute of one of the option items, but this does not actually work after i initialize the control/widget:


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.bootstrap5.min.css" integrity="sha512-Ars0BmSwpsUJnWMw+KoUKGKunT7+T8NGK0ORRKj+HT8naZzLSIQoOSIIM3oyaJljgLxFi0xImI5oZkAWEFARSA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js" integrity="sha512-IOebNkvA/HZjMM7MxL0NYeLYEalloZ8ckak+NDtOViP7oiYzG5vn6WVXyrJDiJPhl4yRdmNAG49iuLmhkUdVsQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<select id="contract" name="contract" class="selectpicker form-control" data-live-search="true" alt="" >
<option>Select Contract</option>;
{% for n in contract_lst %}
	<option value="{{n.contract_code}}" {% if resp_data.contract_code==n.contract_code %} selected {% endif %}>{{n.contract_name}}</option>';    
{% endfor %}
</select>

This is how i am initializing:

$('#coontract').selectize({ 
	sortField: 'text',
	closeAfterSelect: true,
	allowEmptyOption: true,                
	onChange: function(value){ fetchChartOnChange(); }
});          

Any help resolving these issues would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant