<button mat-button id="categories-button" [mat-menu-trigger-for]="categoryList">
<span>categories</span>
<mat-icon id="drop-arrow">arrow_drop_down</mat-icon>
</button>
<mat-menu #categoryList>
<mat-form-field appearance="standard" id="category-search-wrapper">
<input (click)="$event.stopPropagation()" matInput id="category-search">
</mat-form-field>
<button mat-menu-item>Settings</button>
<button mat-menu-item>Help</button>
</mat-menu>
I want category-search input to be focused, when Menu is opened, the problem is it doesn't seem to be ready yet, when menuOpened event is emitted. How can I focus input element when Menu is opened?

mat-menunot in DOM when its closed? If so, it should fire cause that directive will be initiated every time input is inserted into DOM, that is if.tick()/nextTick(that runs your code next time the DOM updates. It's a solve for this exact problem.