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

Feature Request: Optionally disable animation on ':navigateTo' prop #257

Closed
fikkatra opened this issue Aug 8, 2018 · 6 comments
Closed
Labels
feature good first issue This issue is good for a new vue developer! help wanted

Comments

@fikkatra
Copy link

fikkatra commented Aug 8, 2018

I'm looking for a way to initialize the carousel at a given page number. In my case, I want to show the last slide immediately when my component is loaded.

I've looked at the navigateTo property. This works, but it has the disadvantage that you see the animation: the carousel moves to the last page while sliding through all previous pages.

Other things I tried:
The following does not work (currentPage is updated but the correct page isn't shown):

mounted() {
  this.$refs.carousel.goToPage(lastPageIndex);
}

The following works, but it also shows the animation:

mounted() {
	this.$nextTick(() => {
	  this.$refs.carousel.goToPage(lastPageIndex);
	});
}

Related to this and this issue, but neither of them solved the problem.

@quinnlangille quinnlangille added help wanted feature good first issue This issue is good for a new vue developer! labels Aug 9, 2018
@quinnlangille quinnlangille changed the title Set initial page programmatically (without animation) Feature Request: Optionally disable animation on ':navigateTo' prop Aug 9, 2018
@quinnlangille
Copy link
Member

Hey @fikkatra, this functionality isn't currently supported but would likely be easy to engineer. I'll flag this as a feature request.

I would envision navigateTo to simply take an optional display toggle, i.e

:navigateTo= [1, false]

That's just the first thing that comes to mind, so if anyone has another idea feel free to submit a PR and I'll review right away :~)

quinnlangille pushed a commit that referenced this issue Sep 5, 2018
* Feat: #257

* updating #278
@quinnlangille
Copy link
Member

Just released @utkarshnag's feature for this! Going to close the issue, feel free to comment here if there are any questions :octocat:

@cvetkovskin
Copy link

cvetkovskin commented Dec 4, 2018

It seems that though the implementation of the feature has been merged, the prop type of navigateTo is still a Number, therefore a Invalid prop: type check failed error is being fired if you pass the array to it.

Can you please change it to [Number, Array]?

@quinnlangille
Copy link
Member

Good call @cvetkovskin! Missed that in review, I'll make a fix later today

@rico-ocepek
Copy link
Contributor

rico-ocepek commented Feb 6, 2019

@quinnlangille @ashleysimpson don't forget this one please ;)

@rico-ocepek
Copy link
Contributor

@quinnlangille @ashleysimpson
I fixed the issue and created a PR that fixes the issue and includes the missing readme update

#366

Btw thank you for your work here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue This issue is good for a new vue developer! help wanted
Projects
None yet
Development

No branches or pull requests

4 participants