From 28bd768793783fdf9f0a9fb2f7036367fc198bfd Mon Sep 17 00:00:00 2001 From: thecodrr Date: Sun, 17 Oct 2021 01:45:21 +0500 Subject: [PATCH] fix: weird glitch in codeblock on tab key press --- packages/tinymce-plugins/codeblock/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/tinymce-plugins/codeblock/index.js b/packages/tinymce-plugins/codeblock/index.js index d8f4c99cf..c3c1ff613 100644 --- a/packages/tinymce-plugins/codeblock/index.js +++ b/packages/tinymce-plugins/codeblock/index.js @@ -171,12 +171,7 @@ var registerHandlers = function (api, editor) { moveCaretTo(node, characterRange.start, endIndex); } else { // TODO: handle line deindent - node.textContent = insertAt(text, TAB, characterRange.start); - moveCaretTo( - node, - characterRange.start + TAB.length, - characterRange.end + TAB.length - ); + editor.insertContent(TAB); } } else { editor.insertContent(TAB);