From 4860f353d5dc0a53118552f642765d801671600d Mon Sep 17 00:00:00 2001 From: Gavin Foley Date: Tue, 18 Feb 2014 08:33:00 +1300 Subject: [PATCH] ui-select2 does not split on select2's "separator" option for multiple Bug related to PR #115. Updated code to split on separator option instead of a comma. Splitting on a comma breaks if selected tag contains a comma e.g. selecting "Springsteen, Bruce" would cause two tags. --- src/select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select2.js b/src/select2.js index 828032d..c7d8db2 100644 --- a/src/select2.js +++ b/src/select2.js @@ -98,7 +98,7 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec if (opts.multiple) { var viewValue = controller.$viewValue; if (angular.isString(viewValue)) { - viewValue = viewValue.split(','); + viewValue = viewValue.split(opts.separator); } elm.select2( 'data', convertToSelect2Model(viewValue));