Open benesch opened 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.
There are three selection/caret related events:
caretUpdated
Fires on keyup, range updated, and mousedown, range not yet updatedcaretPositioned
Fires on arrow key keydown, range not yet updatedselectionChanged
Fires on mouseup, range updatedProblem:
selectionChanged
doesn't currently fire for keyboard events, andcaretUpdated
fires for amousedown
before the selection updates. I'm currently listening to bothcaretUpdated
andselectionChanged
, which results in some extraneous calls to the event handler onmousedown
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 updatedselectionPositioned
Fires on arrow key keydown w/ arrow key and mousedown, range not yet updated