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

[Bug Report] V-slide-group arrows fail when adding slide items when v-slide-group has v-show==false #10455

Closed
jaunt opened this issue Feb 5, 2020 · 11 comments
Assignees
Labels
C: VSlideGroup T: bug Functionality that does not work as intended/expected
Milestone

Comments

@jaunt
Copy link

jaunt commented Feb 5, 2020

Environment

Vuetify Version: 2.2.9
Vue Version: 2.6.11
Browsers: Chrome 80.0.3987.87
OS: Mac OS 10.13.6

Steps to reproduce

Using the codepen link:

  1. Click add and see that items successfully add to the slide group.
  2. Click hide, which toggles v-show to false on the slide group. (Note, this happens in my app because a route with a slide group is set as "keep alive", so when I come back to the route, it causes this issue).
  3. Add to the slide group with the add button while the slide group is still hidden.
  4. Click hide to toggle v-show so that the slide group becomes visible again, and see that its arrows are erroneously gone.

Expected Behavior

When slide group comes becomes visible again, the arrows visibility should be figured out automatically.

Actual Behavior

When the slide group becomes visible, arrows are gone.

Reproduction Link

https://codepen.io/jauntcode/pen/KKpPROd

@ghost ghost added the S: triage label Feb 5, 2020
@jaunt
Copy link
Author

jaunt commented Feb 15, 2020

I wonder if the solution is to call setWidths() when the vue activated lifecycle event fires? https://vuejs.org/v2/api/#activated

@Leespiker Leespiker added S: needs reproduction The issue does not contain a valid reproduction C: VSlideGroup and removed S: triage labels Apr 3, 2020
@Leespiker
Copy link
Contributor

@jaunt Your reproduction link is working as expected for me. Please create another one if it's still not working for you.

@jacekkarczmarczyk jacekkarczmarczyk removed the S: needs reproduction The issue does not contain a valid reproduction label Apr 6, 2020
@jacekkarczmarczyk
Copy link
Member

I can reproduce it in current chrome

@ajayidavid99

This comment has been minimized.

@aribornstein

This comment has been minimized.

@TonyDeplanque

This comment has been minimized.

@dumptyd
Copy link

dumptyd commented Sep 14, 2020

I'm using this workaround for now

<template>
  <v-slide-group v-show="isVisible" ref="slideGroup">
    <v-slide-item>...</v-slide-item>
  </v-slide-group>
</template>
<script>
export default {
  watch: {
    isVisible(val) {
      if (val) this.$refs.slideGroup.setWidths();
    }
  }
};
</script>

@digisomni
Copy link
Contributor

This is a problem with Vuetify 2.3.9. No workarounds are currently working for me.

@k3ssen
Copy link

k3ssen commented Oct 24, 2021

Using dumptyd's suggestion works for me after the slide-items have been loaded. Directly calling this.$refs.slideGroup.setWidths(); didn't work for me and even calling it inside in this.$nextTick didn't work. However, it did work when using a timeout that waits long enough.
(I'm using vuetify version 2.5.8)

@MaxWeisen
Copy link

MaxWeisen commented Dec 6, 2021

Using dumptyd's suggestion works for me after the slide-items have been loaded. Directly calling this.$refs.slideGroup.setWidths(); didn't work for me and even calling it inside in this.$nextTick didn't work. However, it did work when using a timeout that waits long enough. (I'm using vuetify version 2.5.8)

@k3ssen
Calling this.$refs.slideGroup.setWidths(); in Vue's updated () lifecycle hook made this workaround effective for me.

@serdarcanerden
Copy link

.v-slide-group:not(.v-slide-group--has-affixes) > .v-slide-group__prev,
.v-slide-group:not(.v-slide-group--has-affixes) > .v-slide-group__next {
display: inherit !important;
}
.v-slide-group__next--disabled,
.v-slide-group__prev--disabled {
pointer-events: auto !important;
}

For my case adding these css classes as above solved the issue. While selecting something from the items arrows were appearing but without interaction these css classes were blocking them (show-arrows was used). These are coming as display : none and pointer-events : none

@KaelWD KaelWD added the T: bug Functionality that does not work as intended/expected label Jun 19, 2022
@KaelWD KaelWD self-assigned this Jun 19, 2022
@KaelWD KaelWD added this to the v2.6.x milestone Jun 19, 2022
@KaelWD KaelWD closed this as completed in 7b4db9a Jun 19, 2022
KaelWD added a commit that referenced this issue Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VSlideGroup T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests