I have this really simple observable element which for some reason does not update in IE8
<body>
<form data-bind="submit: show">
<input type="text" data-bind="value: someText" />
</form>
<script type="text/javascript">
var ViewModel = function () {
var self = this;
self.someText = ko.observable('initial value');
self.show = function () {
alert(self.someText());
self.someText('');
}
}
ko.applyBindings(new ViewModel());
</script>
</body>
So, when enter is clicked, the value inputed into textbox should be displayed. Everything fine in mozilla, opera, chrome. IE does not see any changes and always alerts with a empty string. Why?
Here you can run this piece of code
Sorry, I should google it carefully. The problem was in different event after which observable element should be updated. Little fix for IE looks like this
<input type="text" data-bind="value: someText, valueUpdate: 'keydown'" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With