Skip to content

Expansion panel (opened) #12433

Closed
Closed
@Swoox

Description

@Swoox

Bug, feature request, or proposal:

Bug

What is the expected behavior?

I have a loop of 4 expansion panels I open the expansion panel based on index.
After the panel open itself it will trigger (opened).

<div *ngFor="let arrays of form.controls.array.controls; let j = index">
   <mat-expansion-panel [expanded]="j === selectedCategory" (opened)="onExpand()">

The onExpand will be called.
In this function I do a focus on the first input inside the expansion panel.

What is the current behavior?

It doesn't focus the first input.
document.getElementById(21).focus();
This doesn't work.

What are the steps to reproduce?

Stackblitz is bugged with the newest animations it will give an error.

What is the use-case or motivation for changing an existing behavior?

I expect the onExpand to be triggered after the panel is totally loaded in the dom so I can acces the content within.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.5
Materials 6.0.2
TypeScript 2.7.2

Is there anything else we should know?

It's working when the panel is open or when I put an timeout of 50 miliseconds inside the function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions