Title: How can I get the height of select2 drop-down?
Tags: jquery;css;jquery-select2;ui-select2
Question: I am trying to get select2 drop-down actual rendered height, but:
If i use something like this:
$('#my-input-s2').on('select2-open', function() {
var height = $(".my-dropdown").first().height()
console.log(height)
The result is always 29
And when i use this(because select2 is not fullly open because of reading remote data:
$('#my-input-s2').on('select2-open', function() {
var height = setTimeout($(".my-dropdown").first().height(),0)
console.log(height)
I result is gradually increasing value on every open of select2 (eg. 102, then 109, then 114)
But I need to determine the height of dropdown when the select2 is fully open
* edit (fully open = when the openning is done)
Thanx for your answers

Here is the accepted answer: My solution:
Hang it to another event:
select2-highlight
Fired when a choice is highlighted in the dropdown.
$('#my-input-s2').on('select2-highlight', function() {
var height = $(".my-dropdown").height()
})

Here is another answer: Isn't it a set value? The select2 CSS says:
.select2-results {
margin: 4px 4px 4px 0;
max-height: 200px;
overflow-x: hidden;
overflow-y: auto;
padding: 0 0 0 4px;
position: relative;
So the height of a fully open dropdown box is 200px (+8 margin).
Comment for this answer: Yes, but this is max-height, but if the result is only eg. 3 options the actual height is smaller
Comment for this answer: OK, sorry I need to get the actual height of dropdown, not the max height from css. (I mean fully open = when the openning is done)
Comment for this answer: then I don't understand your question, sorry. From your post you know and can get the height, and you are explicitly asking for the height when it's fully open, which I answered...

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:10/03/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<jquery><css><jquery-select2><ui-select2>', 'Title': 'How can I get the height of select2 drop-down?', 'ViewCount': 5391, 'id': 26183361, 'user_AboutMe': '', 'user_AccountId': 3658676.0, 'user_DisplayName': 'dusty', 'user_Reputation': 179.0, 'user_Views': 28.0, 'user_id': 3049055.0}}