MOBILE-4470 rte: Fix RTE outside ion-item
parent
f4697a298a
commit
19473b345f
|
@ -218,11 +218,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
||||||
this.deleteDraftOnSubmitOrCancel();
|
this.deleteDraftOnSubmitOrCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
const ionItem = this.element.closest<HTMLIonItemElement>('ion-item');
|
this.setupIonItem();
|
||||||
if (!ionItem) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ionItem.classList.add('item-rte');
|
|
||||||
|
|
||||||
if (this.editorElement) {
|
if (this.editorElement) {
|
||||||
const debounceMutation = CoreUtils.debounce(() => {
|
const debounceMutation = CoreUtils.debounce(() => {
|
||||||
|
@ -232,9 +228,19 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
||||||
this.contentObserver = new MutationObserver(debounceMutation);
|
this.contentObserver = new MutationObserver(debounceMutation);
|
||||||
this.contentObserver.observe(this.editorElement, { childList: true, subtree: true, characterData: true });
|
this.contentObserver.observe(this.editorElement, { childList: true, subtree: true, characterData: true });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup Ion Item adding classes and managing aria-labelledby.
|
||||||
|
*/
|
||||||
|
protected setupIonItem(): void {
|
||||||
|
const ionItem = this.element.closest<HTMLIonItemElement>('ion-item');
|
||||||
|
if (!ionItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ionItem.classList.add('item-rte');
|
||||||
|
|
||||||
const label = ionItem.querySelector('ion-label');
|
const label = ionItem.querySelector('ion-label');
|
||||||
|
|
||||||
if (!label) {
|
if (!label) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue