From 9e17f6301334f21ca358f21285d6d00f75b90fb0 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Wed, 11 Jun 2014 20:02:23 -0400 Subject: [PATCH] Normalized `select2-selecting` event This normalizes the `select2-selecting` event so the object is returned as `choice` in the event data. While the documentation points to the name being `object`, all other events return the affected data object as `choice`. This closes the following issue: https://github.com/ivaynberg/select2/issues/2340 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index a07e3231..1803259a 100644 --- a/select2.js +++ b/select2.js @@ -1124,7 +1124,7 @@ the specific language governing permissions and limitations under the Apache Lic // abstract triggerSelect: function(data) { - var evt = $.Event("select2-selecting", { val: this.id(data), object: data }); + var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data }); this.opts.element.trigger(evt); return !evt.isDefaultPrevented(); },