-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection constructor should accept ranges array #3822
Comments
As I talked with @Reinmar, we'll create a new static function rather than change the constructor, so there'll be no need to rewrite existing code. Usageconst sel = Selection.createFromRanges( [ range1, range2 ] );
// And with isLastBackward set to true:
const sel2 = Selection.createFromRanges( [ range1, range2 ], true ); NoteThe |
It's not needed but it changed nothing because you can't listen on it :D
TBH, I think I might've changed my mind. Why I initially thought about moving it to a separate method was that I wasn't sure whether this is an identical case to |
Ok, it makes sense, so I'll move this code to the constructors :D |
I pushed the corrected version which still uses |
Let's discuss this under ckeditor/ckeditor5-engine#918. |
Feature: Allow passing ranges to the selection constructors (in the model and in the view). Closes #600.
Cause, currently I have to do this:
Which could be simplified.
The text was updated successfully, but these errors were encountered: