diff --git a/src/addons/mod/forum/tests/behat/snapshots/test-basic-usage-of-forum-activity-in-app-reply-a-post_14.png b/src/addons/mod/forum/tests/behat/snapshots/test-basic-usage-of-forum-activity-in-app-reply-a-post_14.png
index a9133c576..8bb8198cc 100644
Binary files a/src/addons/mod/forum/tests/behat/snapshots/test-basic-usage-of-forum-activity-in-app-reply-a-post_14.png and b/src/addons/mod/forum/tests/behat/snapshots/test-basic-usage-of-forum-activity-in-app-reply-a-post_14.png differ
diff --git a/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html b/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html
index 6b476e077..8c519d6da 100644
--- a/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html
+++ b/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html
@@ -1,5 +1,5 @@
-
diff --git a/src/core/features/editor/components/rich-text-editor/rich-text-editor.scss b/src/core/features/editor/components/rich-text-editor/rich-text-editor.scss
index f0880e535..954c8dbd2 100644
--- a/src/core/features/editor/components/rich-text-editor/rich-text-editor.scss
+++ b/src/core/features/editor/components/rich-text-editor/rich-text-editor.scss
@@ -1,6 +1,5 @@
@use "theme/globals" as *;
:host {
- --placeholder-color: var(--ion-placeholder-color);
--toobar-background: var(--white);
--button-color: var(--ion-text-color);
--button-active-color: var(--gray-300);
@@ -80,11 +79,14 @@
max-width: 95%;
width: auto;
}
+ &.empty:before,
&:empty:before {
content: attr(data-placeholder-text);
display: block;
color: var(--placeholder-color);
- font-weight: bold;
+ position: absolute;
+ opacity: var(--placeholder-opacity);
+ user-select: none;
}
// Make empty elements selectable (to move the cursor).
diff --git a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts
index 3ef93383a..d35076d14 100644
--- a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts
+++ b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts
@@ -156,6 +156,8 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
ol: 'false',
};
+ isEmpty = true;
+
swiperOpts: SwiperOptions = {
modules: [IonicSlides],
slidesPerView: 6,
@@ -590,13 +592,17 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
*/
protected isNullOrWhiteSpace(value: string | null | undefined): boolean {
if (value === null || value === undefined) {
+ this.isEmpty = true;
+
return true;
}
value = value.replace(/[\n\r]/g, '');
value = value.split(' ').join('');
- return value.length === 0;
+ this.isEmpty = value.length === 0;
+
+ return this.isEmpty;
}
/**
diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss
index 3f6e0b578..1e98b27b7 100644
--- a/src/theme/theme.base.scss
+++ b/src/theme/theme.base.scss
@@ -891,7 +891,8 @@ td {
ion-input,
ion-input input,
-ion-textarea {
+ion-textarea,
+core-rich-text-editor {
--placeholder-color: var(--ion-placeholder-color);
--placeholder-opacity: .65;
}