I have a DropDownList with the following bindings:
<select data-bind="value: DropDownValue, event: { change: OnChange }"> <option value="1">Val 1</option> /* and more */ </select> The OnChange event is fired correctly when the user select a different value from the DropDownList.
The event is also fired when updating the value of the observable property using viewModel.DropDownValue(1).
What I'm trying to achieve, is to trigger the change event ONLY when the user sets the value through the UI.
Is it possible to block the change event when updating the value through the observable?
This is the JSFiddle example: https://jsfiddle.net/5ex5j7jL/3/
optionsbinding?valuebinding because the DropDownList is already rendered on the HTML with all the necessary options. With theoptionsbinding, you have to provide an array of objects and let knockout create the HTML for you.isTrustedproperty of theeventobject