Search code examples
autocompleteknockout.jsinternet-explorer-9

Knockout.js Textbox Value Binding Auto-Complete


I have a text input field bound to a viewmodel using a Knockout.js value binding. In IE9 if I type in the first few letters of my username, I get the standard auto-complete dropdown. Selecting my username from the auto-complete does not update my viewmodel. Is there a way to trigger an update to my observable from an auto-complete selection?

<input type="text" data-bind="value: userName" />

Solution

  • This issue was submitted as a bug 1 year ago:

    https://github.com/SteveSanderson/knockout/pull/122

    It seems a fix been included in the 2.1.0 version of knockout.js - so if you update it should fix this issue for you.

    If this is not possible, an alternative suggestion is to just turn autocomplete off on your username <input> using the attribute autocomplete="off"