It seems that I always end up finding a solution right after setting up a bounty, even if I wait months before starting that bounty.
The problem was with the code inside the update
function of my custom binding. After the observable value of the select changes, I also need to manually update select2, like so:
update: function(element, valueAccessor, allBindingsAccessor) {
var value = ko.utils.unwrapObservable(allBindingsAccessor().value || allBindingsAccessor().selectedOptions);
if (value) $(element).select2('val', value);
}
Working code: http://jsfiddle.net/LgXcb/5/