Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tabs] Input focus breaks sliding animation #5238

Closed
Mario-Eis opened this issue Jun 20, 2017 · 11 comments
Closed

[Tabs] Input focus breaks sliding animation #5238

Mario-Eis opened this issue Jun 20, 2017 · 11 comments
Assignees
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Mario-Eis
Copy link

Bug, feature request, or proposal:

Bug (or feature request)

What is the expected behavior?

Tab animation should run flawless.
Or an alternative way should be provided to handle the focus when browsing tabs

What is the current behavior?

If the focus is set to an element in the new visible tab, the animation breaks

What are the steps to reproduce?

http://plnkr.co/edit/JOaZUON0G7JTBcEWlZTJ?p=preview

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

Handle input focus when browsing tabs

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

4.2.3 / beta.6, at least chrome and opera

Is there anything else we should know?

Slide from the left side seems to work, slide from the right side is broken when focus is set.
Setting the focus within a 500ms timeout works, but has other problems like when users switches the tabs to fast (second tab-switch within the 500ms timeout). Also the 500ms would be hard coded in the component host and could not be compatible to future tab animation implementations.
Providing a hook to @translateTab.done could be a possible quick-fix.

@jelbourn jelbourn added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jun 20, 2017
@jelbourn jelbourn assigned amcdnl and unassigned andrewseguin Aug 7, 2017
@amcdnl
Copy link
Contributor

amcdnl commented Aug 21, 2017

@jelbourn - Are you ok w/ exposing the onCentered event from the body?

@jelbourn
Copy link
Member

@amcdnl don't quite follow what you mean

@amcdnl
Copy link
Contributor

amcdnl commented Aug 23, 2017

@jelbourn - onCentered is an event emitted from the tab-body component when the animation has finished. Its hidden and not re-emitted for public consumption, my suggestion to address his issue was to expose this event for consumption by external consumers.

@jelbourn
Copy link
Member

I wouldn't be a fan of that API. What's the underlying problem?

@amcdnl
Copy link
Contributor

amcdnl commented Aug 30, 2017

The user wants the ability to set focus once the animation has completed.

@Mario-Eis
Copy link
Author

Doesn't necessarily need to be set once the animation is complete. Thats just one way to do it. The issue is, thats it's not possible to set the focus at all. Except for some dirty workarounds described above. I could imagine the underlaying issue could be the inputs focus animation breaking the tabs sliding animation... just a guess.

@jelbourn
Copy link
Member

Something like (animationDone) would be more general. @matsko, do you have any input in general for use-cases like this?

@amcdnl
Copy link
Contributor

amcdnl commented Sep 1, 2017

@jelbourn - let me know if you want me to move forward with that API.

@jelbourn
Copy link
Member

jelbourn commented Sep 1, 2017

Matias said that such a feature would be reasonable to add to animations in general, but it wouldn't be any time soon. I suppose (animationDone) works for now

amcdnl added a commit to amcdnl/material2 that referenced this issue Sep 2, 2017
@amcdnl amcdnl added the has pr label Sep 11, 2017
@andrewseguin andrewseguin changed the title Input focus breaks md-tab sliding animation [Tabs] Input focus breaks md-tab sliding animation Oct 19, 2017
@andrewseguin andrewseguin changed the title [Tabs] Input focus breaks md-tab sliding animation [Tabs] Input focus breaks sliding animation Oct 19, 2017
andrewseguin pushed a commit that referenced this issue Dec 13, 2017
* feat(tabs): add animation done event #5238

* chore(test): add test

* chore(tests): remove fit
@mmalerba mmalerba assigned mmalerba and unassigned amcdnl Dec 2, 2022
@mmalerba
Copy link
Contributor

mmalerba commented Dec 2, 2022

Confirmed (animationDone) is working in v15

@mmalerba mmalerba closed this as completed Dec 2, 2022
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants