Skip to content

fix(tab): transitions #901

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

Merged
merged 4 commits into from
Aug 21, 2017
Merged

fix(tab): transitions #901

merged 4 commits into from
Aug 21, 2017

Conversation

mosinve
Copy link
Member

@mosinve mosinve commented Aug 21, 2017

Make it transition again
Attempt to fix #504

@codecov-io
Copy link

codecov-io commented Aug 21, 2017

Codecov Report

Merging #901 into dev will decrease coverage by 0.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##             dev     #901      +/-   ##
=========================================
- Coverage   38.7%   38.68%   -0.02%     
=========================================
  Files         69       69              
  Lines       2377     2378       +1     
  Branches     685      685              
=========================================
  Hits         920      920              
- Misses      1300     1301       +1     
  Partials     157      157
Impacted Files Coverage Δ
lib/components/tab.vue 43.75% <33.33%> (-2.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48d3729...cec4089. Read the comment docs.

@tmorehouse tmorehouse changed the title fix(tab) transitions fix(tab): transitions Aug 21, 2017
Remove `v-if` as it impossible to use both `v-if` and `v-show` on one component, and in case `v-if` transitions applied with artifacts
@mosinve mosinve requested a review from tmorehouse August 21, 2017 04:44
@@ -7,8 +7,7 @@
:aria-hidden="localActive ? 'false' : 'true'"
:aria-expanded="localActive ? 'true' : 'false'"
:aria-lablelledby="controlledBy || null"
v-if="localActive || !lazy"
v-show="localActive || lazy"
v-show="localActive"
Copy link
Member

@tmorehouse tmorehouse Aug 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if this was:

v-if="localActive || !lazy"
v-show="localActive"

Would that make a difference?

Some people may not want any child components of a tab rendered if not visible.

Copy link
Member Author

@mosinve mosinve Aug 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's a v-show, then element will be rendered anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if only v-if stay... transitions are buggy...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then .. judgement is simple- v-show is the only case when this component works just like original BS4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But removing the lazy part will always render with v-show (but just have display:none; set), so the content of the tabs will always be in the dom (and potentially active) even though not visible, which may not be the desired state for some users

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if we move the lazy part to the tab content slot? So the tab itself is always present 9but hiding with v-show), but the content inside can be taken out of DOM via a v-if?

Copy link
Member

@tmorehouse tmorehouse Aug 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this:

                   v-show="localActive"
                   ref="panel"
        >
             <template v-if="localActive || !lazy">
                 <slot></slot>
             </template>
</component>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check updated file... seems to work, at least at playground

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the catch is we must spread active and show classes in time...

Seems, found a solution
@mosinve mosinve merged commit a4b2862 into dev Aug 21, 2017
@mosinve mosinve deleted the fix-tab-transition branch August 21, 2017 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs not fading
3 participants