NYTimes/ice — Issue #10: selectionChanged doesn't fire for keyboard events
Author: primatology
Created: 2012-03-05 02:06:00+00:00
State: open

There are three selection/caret related events:

* `caretUpdated`
Fires on **keyup**, range updated, and **mousedown,** range not yet updated

* `caretPositioned`
Fires on arrow key **keydown,** range not yet updated

* `selectionChanged`
Fires on **mouseup,** range updated

Problem: `selectionChanged` doesn't currently fire for keyboard events, and `caretUpdated` fires for a `mousedown` before the selection updates. I'm currently listening to both `caretUpdated` and `selectionChanged`, which results in some extraneous calls to the event handler on `mousedown` before the selection's actually changed.

----------

Am I missing the original design philosophy? I think you could consolidate nicely like so:

* `selectionUpdated`
Fires on **keyup** and **mouseup**, range updated

* `selectionPositioned`
Fires on arrow key **keydown** w/ arrow key and **mousedown,** range not yet updated