rniemeyer / knockout-jqAutocomplete

knockout-jqAutocomplete is a Knockout.js plugin designed to work with jQuery UI's autocomplete widget.
MIT License
49 stars 20 forks source link

Do not return a value if the index does not exist #34

Open vanderlee opened 7 years ago

vanderlee commented 7 years ago

If, for some reason, a non-existent value is set for the input, it will set undefined as the value for the input. This change empties the value instead. I don't know if this causes side-effects for other use cases, but it seems to work for me.

ryantheleach commented 7 years ago

I've seen the behaviour you described also, as well as when expecting an object, seeing a string instead.

e.g. I blank the input, press escape, and the sent value is the previous display value, rather then what I would expect: a empty / null value.

Even if it were expected behaviour to rollback, I would have expected to see the previous object, not the display string.