When using a mat-select element in my custom element the options are shown outside the created shadow dom in HTML that means the options are not shown right below the select control.
As far as I figured out I need to set ViewEncapsulation to ShadowDom. Only this way my custom element worked in all browsers. So the solution to my problem should be using ShadowDom.
Component({
selector: 'app-survey',
templateUrl: './survey.component.html',
styleUrls: ['./survey.component.css'],
encapsulation: ViewEncapsulation.ShadowDom
})
<mat-form-field #ff>
<mat-select placeholder="Auswahl ERP System" [(ngModel)]="erpSystem">
<mat-option *ngFor="let choice of erpSystemAuswahl" [value]="choice">
{{choice}}
</mat-option>
</mat-select>
</mat-form-field>
I expect the options shown right with the select element. How to I change the behaviour of the options to be shown correctly?