From bc144525857b9f7673955973b3cbd6cf1113a42c Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 28 May 2019 19:40:28 +0200 Subject: [PATCH] FIX: ensures events have access to correct context (#7621) --- app/assets/javascripts/select-kit/mixins/events.js.es6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/select-kit/mixins/events.js.es6 b/app/assets/javascripts/select-kit/mixins/events.js.es6 index a838ea38afd..519271942f3 100644 --- a/app/assets/javascripts/select-kit/mixins/events.js.es6 +++ b/app/assets/javascripts/select-kit/mixins/events.js.es6 @@ -148,17 +148,17 @@ export default Ember.Mixin.create({ didInsertElement() { this._super(...arguments); - $(document).on("mousedown.select-kit", this._mouseDownHandler); + $(document).on("mousedown.select-kit", this._mouseDownHandler.bind(this)); this.$header() .on("blur.select-kit", this._blurHeaderHandler.bind(this)) .on("focus.select-kit", this._focusHeaderHandler.bind(this)) .on("keydown.select-kit", this._keydownHeaderHandler.bind(this)) - .on("keypress.select-kit", this._keypressHeaderHandler); + .on("keypress.select-kit", this._keypressHeaderHandler.bind(this)); this.$filterInput() .on("change.select-kit", this._changeFilterInputHandler.bind(this)) - .on("keypress.select-kit", this._keypressFilterInputHandler) + .on("keypress.select-kit", this._keypressFilterInputHandler.bind(this)) .on("focusout.select-kit", this._focusoutFilterInputHandler.bind(this)) .on("keydown.select-kit", this._keydownFilterInputHandler.bind(this)); },