Skip to content

Typeahead doesn't update list when the bound observableArray changes #65

Description

@gerritdaniels

The typeahead binding only has an init method, so when the observable changes the new values don't get set to tht typeahead source. You can add the following update method to the typehead binding:

 update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
    var $element = $(element);
    $element.attr("autocomplete", "off").data('typeahead').source = ko.utils.unwrapObservable(valueAccessor());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions