Skip to content

Commit 9e17f63

Browse files
author
Kevin Brown
committed
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
1 parent b13c9b4 commit 9e17f63

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ the specific language governing permissions and limitations under the Apache Lic
11241124

11251125
// abstract
11261126
triggerSelect: function(data) {
1127-
var evt = $.Event("select2-selecting", { val: this.id(data), object: data });
1127+
var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data });
11281128
this.opts.element.trigger(evt);
11291129
return !evt.isDefaultPrevented();
11301130
},

0 commit comments

Comments
 (0)