Hi,
I think using more than one letter items (for example "hello, world") introduces empty items for the original plnkr code.
I replaced string operations with list operations:
if (itemList.indexOf($scope.sel_val) === -1) {
$scope.sel_val = itemList[0];
}
This seems to work somewhat better, but still I manage to get empty items:
For example (with the above code using list operations):
0) string is showing "a,b,c,e"
1) prepend ",,". The list is showing ",,a,b,c,e"
2) use option box to select the second empty value from the option list
3) remove ",," prefix
4) use option box to select a
Now there is still empty "" at the beginning of the option list.
5) append ",g"
Still the empty "" persists.