ソースを参照

Fixed problem with selection.

Maksymilian Barnaś 9 年 前
コミット
953a8a4de4

+ 5 - 3
packages/ckeditor5-autoformat/src/inlineautoformatengine.js

@@ -153,11 +153,13 @@ export default class InlineAutoformatEngine {
 
 				editor.document.enqueueChanges( () => {
 					selection.setRanges( [ rangeToFormat ] );
+				} );
 
-					formatClb( this.editor, rangeToFormat, batch );
+				// formatClb executes command that has its own enqueueChanges block.
+				formatClb( this.editor, rangeToFormat, batch );
 
-					// FIXME: Problematic part. Changing selection after formatting breaks the formatting.
-					// selection.collapseToEnd();
+				editor.document.enqueueChanges( () => {
+					selection.collapseToEnd();
 				} );
 			} );