From 1be86830986e0435353de5b654d85d0e14090da5 Mon Sep 17 00:00:00 2001 From: Edward Chan Date: Tue, 12 Apr 2016 17:59:17 -0400 Subject: [PATCH] Add option value to selection box trigger change to select the option. The addition of the option value selects the option and makes sure the event target is the selected option. --- src/jquery.selectionBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.selectionBox.js b/src/jquery.selectionBox.js index ae6f4e3..d6a358b 100644 --- a/src/jquery.selectionBox.js +++ b/src/jquery.selectionBox.js @@ -86,7 +86,7 @@ selectOption: function(i) { this.$el.children().eq(i).attr('selected', true); - this.$el.trigger('change'); + this.$el.val(this.$el.children().eq(i).text()).trigger('change'); }, showList: function() {