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 height animation not working with display-directive="show" #3035

Closed
marianheinsen opened this issue May 31, 2022 · 2 comments
Closed

Tabs height animation not working with display-directive="show" #3035

marianheinsen opened this issue May 31, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@marianheinsen
Copy link

TuSimple/naive-ui version (版本)

2.29.0

Vue version (Vue 版本)

3.2.34

Browser and its version (浏览器及其版本)

Chrome(102.0.5005.61)

System and its version (系统及其版本)

MacOS(12.4)

Node version (Node 版本)

v16.15.0

Reappearance link (重现链接)

https://codesandbox.io/s/confident-khayyam-577zk5?file=/src/App.vue

Reappearance steps (重现步骤)

Open the link to CodeSandbox and switch between the Login and Registration tab or:

Create an NTabs component with animated prop and two NTabPanes inside. Use display-directive="show" with both tab panes and make the content of the second pane larger than the first pane. Then switch between the two tabs.

Expected results (期望的结果)

When switching between the tabs, the height of the pane wrapper should transition smoothly according to the height of the content.

Actual results (实际的结果)

Only when switching from the tab with smaller height to the tab with larger height is the height of the pane wrapper animated, not vice versa.

Remarks (补充说明)

With display-directive="if" the height transition is working in both directions, but I need to preserve state between tab switches.

@marianheinsen marianheinsen changed the title Tabs height animation not working with show display directive Tabs height animation not working with display-directive="show" May 31, 2022
@github-actions github-actions bot added the untriaged need to sort label May 31, 2022
@XieZongChen XieZongChen added bug Something isn't working consideration-needed and removed untriaged need to sort labels May 31, 2022
@07akioni
Copy link
Collaborator

07akioni commented Jun 1, 2022

This is an interesting bug. The reason is that beforeLeave hook & enter hook order of vue's transition-group children are not consistent.

@marianheinsen
Copy link
Author

Thanks so much for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants