knockout/knockout — pull request #1334 by mbest (2014-06-03 22:09:27+00:00)
Title: Conflict between afterkeydown and rateLimit

If you bind an observable extended with `rateLimit` using `value` with the `afterkeydown` event, you can end up with characters missing from your value. It is quite hard to reproduce because it depends on the timing being exactly right. But if you could slow down the steps and inject the `keydown` event at the right time, you'll reproduce it every time. Here are the steps:

1. Observable is changed to `'abc'`, which schedules notification in *x* ms.
2. Just before the notification happens, a `keydown` event is triggered, for `'d'`, which schedules an update to the observable in 1 ms.
3. The `'abc'` notification happens and updates the value of the `` to `'abc'`.
4. The observable is updated from the `keydown` event using the current value of the ``, which is `'abc'`. The `'d'` is lost.

This also occurs when using the `throttle` extender instead of `rateLimit`.