I have a select element:
<select [id]="item.value.controlName" [(ngModel)]="item.value.outputVarianteValue"
(focus)="focusControl(item.value.controlName)"
<option *ngFor="let c of item.value.produkte" [ngValue]="c.name">{{c.wert}}</option>
</select>
I rebuild my GUI programmaticaly and want to reset the focus to the element selected before (focusedcontrol)
setTimeout(() => {
const element = this.ngrenderer.selectRootElement('#' + this.focusedControl);
console.log('set root focus: ', this.focusedControl, element)
element.focus();
}, 0)
This works without a problem on normal inputs but not on the selects. After callling ngrenderer.selectRootElement(#myselect)
my select field is empty.