IE9 是否对 Knockout 中的新 textInput 绑定有问题?

Does IE9 have issues with the new textInput binding in Knockout?

根据文档,textInput 提供来自 DOM 的即时更新,这意味着当用户键入时,值会实时更新。

在 IE9 中,我看不到实时值更新。我确实看到它在模糊时更新,但即便如此它也很慢。另外,奇怪的是,使用退格键时更新是即时的。

这是一个错误吗?

在这里查看:http://jsfiddle.net/m2yfkyrk/

Hello <span data-bind="text: name"></span><br>
I said, HELLO <span data-bind="text: upper"></span>!<br>

<input type="text" data-bind="textInput: name">

function VM() {
    this.name = ko.observable("Homer");
    this.upper = ko.computed(function () {
        return this.name().toUpperCase();
    }, this);
}

ko.applyBindings(new VM());

这几乎可以肯定是您系统的问题。除了指出这不是问题的评论者之外,IE9 和此特定绑定是为 Knockout 完成的发布测试的一部分。

超出这一点将很难进行故障排除。尝试关闭浏览器扩展或更新。

似乎 IE9 在处理 textInput 绑定使用的 propertychange 事件时更新 DOM 时出现问题。解决方法是使用 rateLimit:

向可观察对象添加延迟
this.name = ko.observable("Homer").extend({rateLimit:0});

http://jsfiddle.net/m2yfkyrk/1/

Knockout 有一个类似的问题:https://github.com/knockout/knockout/issues/1788