I just followed the way it was done in Select2 theme. Maybe it can be done in a better way in both themes.