centeredSlides on thumbs
See original GitHub issueThis is a (multiple allowed):
-
bug
-
enhancement
-
feature-discussion (RFC)
-
Swiper Version: 6.3.2
-
Platform/Target and Browser Versions: macOS
What you did
I’m using Swiper with react. I have main swiper and thumbs for it. I’m trying to center active thumb.
This is the code for main swiper:
<Swiper
grabCursor
navigation={{
nextEl: '.next-btn',
prevEl: '.prev-btn'
}}
onSlideChange={this.handleSlideChange}
onSwiper={swiper => this.swiper = swiper}
initialSlide={post.initialSlide}
threshold={6}
thumbs={{swiper: this.state.thumbsSwiper}}
>
...
</Swiper>
… And this for thumbs:
<Swiper
onSwiper={thumbsSwiper => this.setState({thumbsSwiper})}
watchSlidesVisibility
watchSlidesProgress
slidesPerView={12}
spaceBetween={12}
threshold={6}
centeredSlides
centeredSlidesBounds
>
Expected Behavior
Expected active thumb to be centered if slides > slidesPerView.
Actual Behavior
Now active slide only tries to be visible on screen. It never moves if is visible on screen. It moves only when grabbing.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
React Swiper: Thumbs centered slides - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >How to center Swiper Slider thumbs with custom width?
No way to answer (To know why) - your thumbs do not align center. Look at the example I made (Works fine //...
Read more >centeredSlides with thumbnail problem | Swiper - Muut
Ok.. so what can I do if I want the thumbs float left? Vladimir Kharlampidi. 04 Mar 2015. Don't use control, or use...
Read more >Thumbs Gallery With Two-way Control - React-id-swiper
Thumbs Gallery With Two-way Control. import React, { useState, useEffect, useRef } from ... centeredSlides: true,. slidesPerView: 'auto',. touchRatio: 0.2,.
Read more >Swiper API
... swiper/less/scrollbar - styles required for Scrollbar module; swiper/less/thumbs - styles required for Thumbs module ... Required centeredSlides: true .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe I’m trying to solve the same problem and have recreated it here.
What I’d like to happen, is that the active thumbnail is always centered (unless it is the first 2 or last 2 in my above example).
Is there a way to natively achieve this?
Is this plugin still maintained? This is still an issue.