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

select() not working after resize #26

Open
blursolo opened this issue Apr 25, 2023 · 1 comment
Open

select() not working after resize #26

blursolo opened this issue Apr 25, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@blursolo
Copy link

blursolo commented Apr 25, 2023

I am using v.2.0.6 in Vue and have a initialized a slideshow like this:

this.flkty = new FlickityResponsive( slideshow, {
 	cellAlign: 'left',
 	prevNextButtons: false,
	pageDots: true,
	wrapAround: true,	
	autoPlay: false,
	pauseAutoPlayOnHover: false,
	draggable: false,
	selectedAttraction: 0.013,
	friction: 0.26,
	dragThreshold: 1,
	adaptiveHeight: true,
	imagesLoaded:true,
	responsive: [{
		breakpoint: 768,
		settings: {
			draggable: true,
			selectedAttraction: 0.2,
    		        friction: 0.8	
		}
	}]		
});

I have a button which, on click, executes the following code:

this.flkty?.select( index, false, false );

It works, but as soon as I downsize the window to match the breakpoint, the code isn't working anymore. There is no error message, it just doesn't do anything. It also doesn't work when I resize the window back to its default desktop size.

Any idea how to fix this?

--- EDIT

Other commands like .next() or .previous() aren't working either..

@phucbm
Copy link
Owner

phucbm commented Apr 26, 2023

It probably loses the instance while switching between breakpoints.
Could you get the instance before executing the methods instead? As stated in #21 (comment)

@phucbm phucbm added the help wanted Extra attention is needed label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants