diff --git a/packages/ckeditor5-typing/src/input.ts b/packages/ckeditor5-typing/src/input.ts index 405070d6cab..672932241a5 100644 --- a/packages/ckeditor5-typing/src/input.ts +++ b/packages/ckeditor5-typing/src/input.ts @@ -101,6 +101,8 @@ export default class Input extends Plugin { } editor.execute( 'insertText', insertTextCommandData ); + + view.scrollToTheSelection(); } ); if ( env.isAndroid ) { diff --git a/packages/ckeditor5-typing/tests/input.js b/packages/ckeditor5-typing/tests/input.js index 69eaa471b87..4f78bbf866f 100644 --- a/packages/ckeditor5-typing/tests/input.js +++ b/packages/ckeditor5-typing/tests/input.js @@ -192,6 +192,19 @@ describe( 'Input', () => { sinon.assert.notCalled( spy ); } ); + + it( 'should scroll to the selection after inserting text', async () => { + const scrollToSelectionSpy = sinon.spy( editor.editing.view, 'scrollToTheSelection' ); + + viewDocument.fire( 'insertText', { + text: 'bar', + selection: viewDocument.selection, + preventDefault: () => {} + } ); + + sinon.assert.calledOnce( insertTextCommandSpy ); + sinon.assert.calledOnce( scrollToSelectionSpy ); + } ); } ); } );