I have the following in my view:
<textarea data-bind="value: content, valueUpdate: 'afterkeydown'"></textarea>
Which when typing, behaves as I'd expect. But I'm using a WMD / Pagedown editor to click a button that adds content to the field, much like StackOverflow's post contents box when you're creating / updating a post.
If I just click a button (to add asterisks or brackets etc) and don't type anything, the value never gets updated in the content
observable.
I do have a save
button that I could use to trigger the "sync" before saving the data by specifiying the input elements to update, but I have no idea if that's possible. What's the proper way to handle this situation?
Update: Jsfiddle to demo the problem: http://jsfiddle.net/BcuLq/
Update 2: This behavior is also happening with a datetime datepicker that I'm using to populate an input with a string. Any generic solution that I can apply to all programatically-filled inputs would be ideal, though I'm not sure if that's a reasonable way to go about this.