nytimes / ice

track changes with javascript
Other
1.71k stars 194 forks source link

selection/caret events don't fire for keyboard events #10

Open benesch opened 12 years ago

benesch commented 12 years ago

There are three selection/caret related events:

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:

delambo commented 12 years ago

@primatology - We cut out a lot of plugins and have refactored since, so some of the old plugin events may not be functioning properly. I've been meaning to write some unit tests for this and a lot more.

I like your proposal - it's clean, and since no plugins are listening to the other events we could get this in without trouble. I can't get to this right now but would love some help from you or anyone that wants to take a stab at this.