MOBILE-3947 behat: Fix RTE behat setField
parent
b73e2c874b
commit
d912d9d9af
|
@ -6,7 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-textarea [hidden]="rteEnabled" #textarea class="core-textarea" role="textbox" [attr.name]="name" ngControl="control"
|
<ion-textarea [hidden]="rteEnabled" #textarea class="core-textarea" role="textbox" [attr.name]="name" ngControl="control"
|
||||||
[placeholder]="placeholder" [attr.aria-label]="placeholder" (ionChange)="onChange()" (ionFocus)="showToolbar($event)"
|
[placeholder]="placeholder" [attr.aria-labelledby]="ariaLabelledBy" (ionChange)="onChange()" (ionFocus)="showToolbar($event)"
|
||||||
(ionBlur)="hideToolbar($event)" />
|
(ionBlur)="hideToolbar($event)" />
|
||||||
|
|
||||||
<div class="core-rte-info-message" *ngIf="infoMessage">
|
<div class="core-rte-info-message" *ngIf="infoMessage">
|
||||||
|
|
|
@ -231,11 +231,18 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateArialabelledBy = () => this.ariaLabelledBy = label.getAttribute('id') ?? undefined;
|
const updateArialabelledBy = () => {
|
||||||
|
this.ariaLabelledBy = label.getAttribute('id') ?? undefined;
|
||||||
|
};
|
||||||
|
|
||||||
this.labelObserver = new MutationObserver(updateArialabelledBy);
|
this.labelObserver = new MutationObserver(updateArialabelledBy);
|
||||||
this.labelObserver.observe(label, { attributes: true, attributeFilter: ['id'] });
|
this.labelObserver.observe(label, { attributes: true, attributeFilter: ['id'] });
|
||||||
|
|
||||||
|
// Usually the label won't have an id, so we need to add one.
|
||||||
|
if (!label.getAttribute('id')) {
|
||||||
|
label.setAttribute('id', 'rte-'+CoreUtils.getUniqueId('CoreEditorRichTextEditor'));
|
||||||
|
}
|
||||||
|
|
||||||
updateArialabelledBy();
|
updateArialabelledBy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue