"open" method not triggering "open" event


I have a question regarding the implementation of the “open” method of the core widget (“select2/core”). I was wondering why it doesn’t trigger the “open” event instead of triggering the “query” event ? Since the “close” method is implemented that way it would make more sense to me. In this implementation, the listener on the “open” event would trigger the “query” event :

Select2.prototype.open = function () {
  if (this.isOpen()) {

  this.trigger('open', {});

Select2.prototype._registerEvents = function () {

  this.on('open', function () {

    this.trigger('query', {});


The underlying question is that, in some case, I would like to prevent the opening when the toggle is triggered. With the current implementation it’s not possible unfortunately.

Does this makes sense to you ?

Thanks a lot,