---
title: Dropdown
taxonomy:
category: docs
process:
twig: true
never_cache_twig: true
---
This chapter covers the appearance and behavior of the dropdown menu.
## Templating
The appearance of search results in the dropdown can be customized by using the `templateResult` option:
## Disabling options
Select2 will correctly handle disabled options, both with data coming from a standard select (when the `disabled` attribute is set) and from remote sources, where the object has disabled: true set.
```
```
## Automatic selection
Select2 can be configured to automatically select the currently highlighted result when the dropdown is closed by using the `selectOnClose` option:
```
$('select').select2({
selectOnClose: true
});
```
## Forcing the dropdown to remain open after selection
You may use the `closeOnSelect` option to prevent the dropdown from closing when a result is selected:
```
$('select').select2({
closeOnSelect: false
});
```
## Dropdown placement
The `dropdownParent` option allows you to pick an element for the dropdown to be appended to:
```
$('select').select2({
dropdownParent: $('#my_amazing_modal')
});
```
### Using a Select2 control inside a Bootstrap modal
If you're having trouble using the search box inside a Bootstrap modal, trying setting the `dropdownParent` option to the modal element.
## Dropdown option groups
In HTML, `