title: Update knockout-bound input field from jQuery autocomplete
body: <p>I have two text inputs on my page: One for a shorthand code and one for the text description of that code. Both inputs have a jQuery autocomplete applied. If the user selects a code from the autocomplete dropdown, it should automatically apply the text as well, and vice versa.</p>
  
  <pre><code>    $('#fc-workPerformedID').autocomplete({
          serviceUrl: BASE_URL + 'Qsys/FaultTypes',
          paramName: 'code',
          width: 'flex',
          autoSelectFirst: true,
          minChars: 1,
          transformResult: response =&gt; ({ suggestions: JSON.parse(response).map(d =&gt; ({ value: d.code, data: d })) }),
          formatResult: formatWT,
          onSelect: function (s) {
              $('#fc-workPerformedText').val(s.data.desc).change(); // I've added change() here
          }
      });
  
      $('#fc-workPerformedText').autocomplete({
          serviceUrl: BASE_URL + 'Qsys/FaultTypes',
          paramName: 'match',
          width: 'flex',
          autoSelectFirst: true,
          minChars: 2,
          transformResult: response =&gt; ({ suggestions: JSON.parse(response).map(d =&gt; ({ value: d.desc, data: d })) }),
          formatResult: formatWT,
          onSelect: function (s) {
              $('#fc-workPerformedID').val(s.data.code).change(); // I've added change() here
          }
      });
  </code></pre>
  
  <p>Quite logically, this didn't update the view model of the other input at first. For that, I found <a href="https://stackoverflow.com/questions/7018885/knockout-js-bound-input-value-not-updated-when-i-use-jquery-valxyz">this</a> approach, where the suggestion was to add a <code>change()</code> command after updating the input's value. I already did that in my code.</p>
  
  <p>The problem with that approach is, that as soon as I call the <code>change()</code> command of that other input field, it also opens its autocomplete menu. So, for example, if I select something on the <code>fc-workPerformedID</code> input, the autocomplete menu of <code>fc-workPerformedText</code> opens immediately after clicking. If I remove the <code>change()</code> call again, it works again as intended.</p>
  
  <p>Is there any way to prevent that? The user experience should simply be: Either enter the code or the text and the other value will be filled automatically and updated in the view model.</p>