When the select2 dropdown is open, I add an option to my select element. The added option however does not appear until after I close and re-open the dropdown.
Select2 gets notified via the MutationObserver that a change has occurred on the underlying select element, and I see that Select2.prototype._syncSubtree() is called. Select2 however does not refresh the dropdown contents at that point.
Here is a fiddle:
https://jsfiddle.net/f0vyhzoa/
Is this a bug or incorrect usage? Is there some other way for me to trigger Select2 to refresh the dropdown widget?
I have ready many, many posts about similar issues but have not been able to find a solution or a definitive answer about the expected behavior.
Thanks!
Peter