8
0
Pārlūkot izejas kodu

Aligned code to changes in Selection API.

Maciej Bukowski 7 gadi atpakaļ
vecāks
revīzija
a073f3c8ab

+ 1 - 1
packages/ckeditor5-typing/src/deletecommand.js

@@ -67,7 +67,7 @@ export default class DeleteCommand extends Command {
 		model.enqueueChange( this._buffer.batch, writer => {
 			this._buffer.lock();
 
-			const selection = Selection.createFromSelection( doc.selection );
+			const selection = new Selection( doc.selection );
 
 			// Do not replace the whole selected content if selection was collapsed.
 			// This prevents such situation:

+ 2 - 4
packages/ckeditor5-typing/tests/input.js

@@ -994,8 +994,7 @@ describe( 'Input feature', () => {
 
 			const paragraph = viewRoot.getChild( 0 );
 			const strong = paragraph.getChild( 0 );
-			const viewSelection = new ViewSelection();
-			viewSelection.setTo( paragraph, 0 );
+			const viewSelection = new ViewSelection( paragraph, 0 );
 
 			// Simulate mutations and DOM change.
 			domRoot.childNodes[ 0 ].innerHTML = '<b>textx</b>';
@@ -1019,8 +1018,7 @@ describe( 'Input feature', () => {
 
 			const paragraph = viewRoot.getChild( 0 );
 			const strong = paragraph.getChild( 0 );
-			const viewSelection = new ViewSelection();
-			viewSelection.setTo( paragraph );
+			const viewSelection = new ViewSelection( paragraph );
 
 			// Simulate mutations and DOM change.
 			domRoot.childNodes[ 0 ].innerHTML = '<strong>Foo bar </strong><b>apple</b>';