Bug in select2:open


#1

Hello,

When using select2:open event I realized that this event is fired before actually the select2 is opened.

I think this is a bug because I expected the event to be fired when the select list is visible.

I found this bug because I need to apply some style in an option of an Ajax populated list.

The select2:open was fired just when the tag

<span class="select2-container select2-container--default select2-container--open" style="position: absolute; top: 119px; left: 1263px;">

is added to the body. After the event was fired, the UL and the LI elements are created showing the list.

Regards
Jaime


#2

I guess it depends on what your definition of “open” is; technically, the Selec2 is “open” as soon as the dropdown is added to the DOM.

Unfortunately, the only way I know to change this is to create your own ResultsAdapter (or possibly DropdownAdapter) so you can trigger the “open” event after the results are displayed in the dropdown.