selections.html 528 B

1234567891011121314151617181920212223242526272829
  1. <section>
  2. <h2>
  3. Can I change how selecting results works?
  4. </h2>
  5. <h3>
  6. Can I select the highlighted result when the dropdown is closed?
  7. </h3>
  8. {% highlight js linenos %}
  9. $('select').select2({
  10. selectOnClose: true
  11. });
  12. {% endhighlight %}
  13. {% include options/not-written.html %}
  14. <h3>
  15. Can I prevent the dropdown from closing when a result is selected?
  16. </h3>
  17. {% highlight js linenos %}
  18. $('select').select2({
  19. closeOnSelect: false
  20. });
  21. {% endhighlight %}
  22. {% include options/not-written.html %}
  23. </section>