From 54a683fbd8af8dbf8482bcfc69c082bcc52060b3 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 26 Jul 2023 09:08:21 +0200 Subject: [PATCH] Fixed handling for placeholders in inline editor. --- .../src/inlineeditorui.ts | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/ckeditor5-editor-inline/src/inlineeditorui.ts b/packages/ckeditor5-editor-inline/src/inlineeditorui.ts index 774c8d3c4be..0ae5c1e2a1c 100644 --- a/packages/ckeditor5-editor-inline/src/inlineeditorui.ts +++ b/packages/ckeditor5-editor-inline/src/inlineeditorui.ts @@ -146,31 +146,27 @@ export default class InlineEditorUI extends EditorUI { } /** - * Enable the placeholder text on the editing root, if any was configured. + * Enable the placeholder text on the editing root. */ private _initPlaceholder(): void { const editor = this.editor; const editingView = editor.editing.view; const editingRoot = editingView.document.getRoot()!; - const placeholder = editor.config.get( 'placeholder' ); - let placeholderText; if ( placeholder ) { - placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[ editingRoot.rootName ]; - } + const placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[ editingRoot.rootName ]; - if ( placeholderText ) { - editingRoot.placeholder = placeholderText; + if ( placeholderText ) { + editingRoot.placeholder = placeholderText; + } } - if ( placeholderText ) { - enablePlaceholder( { - view: editingView, - element: editingRoot, - isDirectHost: false, - keepOnFocus: true - } ); - } + enablePlaceholder( { + view: editingView, + element: editingRoot, + isDirectHost: false, + keepOnFocus: true + } ); } }