From 01447912426d6bfab8a1bb8604e304a341b54f8d Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 23 Mar 2022 09:10:44 +0100 Subject: [PATCH] MOBILE-3833 editor: Fix RTE label --- .../editor/components/rich-text-editor/rich-text-editor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 76e9a1c5b..479933d77 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 @@ -215,8 +215,12 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit, return; } - this.labelObserver = new MutationObserver(() => this.ariaLabelledBy = label.getAttribute('id') ?? undefined); + const updateArialabelledBy = () => this.ariaLabelledBy = label.getAttribute('id') ?? undefined; + + this.labelObserver = new MutationObserver(updateArialabelledBy); this.labelObserver.observe(label, { attributes: true, attributeFilter: ['id'] }); + + updateArialabelledBy(); } /**