components icon indicating copy to clipboard operation
components copied to clipboard

[Tabs] 'animationDone' event is never fired

Open oktav777 opened this issue 8 years ago • 8 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

animationDone should fire when tab body has completed animation.

What is the current behavior?

animationDone event is never fired.

What are the steps to reproduce?

Open console and switch between tabs. You will see that only the selectedTabChange is fired, but animationDone - never https://stackblitz.com/edit/angular-4c9yjl

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

This event is required to (re)intialize components that are dependent on visibility on the screen, because the content of tabs that are not selected is removed from DOM.

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

latest @angular/material (5.1.2)

Is there anything else we should know?

The event is defined in source code and is used in _removeTabBodyWrapperHeight() method, but the method itself is never called.

oktav777 avatar Dec 27 '17 15:12 oktav777

Seems to be fixed in master.

crisbeto avatar Dec 28 '17 10:12 crisbeto

@crisbeto can you point the line in source code?

oktav777 avatar Dec 28 '17 11:12 oktav777

Should be this one https://github.com/angular/material2/blob/master/src/lib/tabs/tab-group.ts#L286. I verified it by putting your example into our demo app.

crisbeto avatar Dec 28 '17 11:12 crisbeto

@crisbeto but the method itself is not called anywhere _removeTabBodyWrapperHeight(), how the event is emitted?

oktav777 avatar Dec 28 '17 11:12 oktav777

It is being called inside the view when a tab becomes active https://github.com/angular/material2/blob/master/src/lib/tabs/tab-group.html#L36.

crisbeto avatar Dec 28 '17 12:12 crisbeto

Ahh ok I got it! Waiting for release!

oktav777 avatar Dec 28 '17 12:12 oktav777

Issue seems to reappear in 5.0.4

https://stackblitz.com/edit/angular-4c9yjl-kpfmev

I created #9322

Mario-Eis avatar Jan 10 '18 14:01 Mario-Eis

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.