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

swiperRef.swipeTo在连续跨越loop边界时会混乱 #6261

Open
dislido opened this issue Jul 19, 2023 · 4 comments
Open

swiperRef.swipeTo在连续跨越loop边界时会混乱 #6261

dislido opened this issue Jul 19, 2023 · 4 comments

Comments

@dislido
Copy link
Contributor

dislido commented Jul 19, 2023

Version of antd-mobile

5.32.0

Operating system and its version

No response

Browser and its version

Edge114

Sandbox to reproduce

https://codesandbox.io/s/interesting-sanderson-qzhw35

What happened?

以sandbox中的例子,Swiper中有6个Item

  • 通过swipeTo(index)连续快速切换-1和0位置时表现正常; 切换到-1并等待动画结束后再切换到0就会向另一个方向滚动
  • 连续切换-1和6位置时表现与上面相反: 慢速时正常,快速切换时方向错误

Relevant log output

No response

@dislido dislido added the bug label Jul 19, 2023
@1587315093
Copy link
Contributor

应该是动画未完成后再点击就会出现闪烁,看着挺蛋疼的😋

@girlyinggao
Copy link

我加了一个backdrop-filter的蒙层,也出现了边界闪烁

@girlyinggao
Copy link

`
.banner {
width: 100vw;
height: 100vh;
}

.bgBanner {
position: relative;
height: 100%;
background-size: 300% 300%;
background-position: center center;
background-repeat: no-repeat;
background-image: url('https://zgy-1255522214.cos.ap-guangzhou.myqcloud.com/1680580659778');
}

.bannerTopContentBg {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.10);
backdrop-filter: blur(50px);
color: #fff;
}

import { Swiper, Button } from 'antd-mobile'
import styles from "@/styles/Home.module.scss";

export default function Home() {
return (
<>


{/* Swiper */}
<Swiper
autoplay
loop

    className={styles.banner}>
      {[1,2,3].map((_,i) => {
        return (
          <Swiper.Item key={i}>
            <div className={styles.bgBanner}>
              <div className={styles.bannerTopContentBg}>
                <p>hello</p>
              </div>
            </div>
          </Swiper.Item>
        )
      })}
    </Swiper>
  </main>
</>

);
}
`

@1587315093
Copy link
Contributor

我加了一个backdrop-filter的蒙层,也出现了边界闪烁

可以像提问的人一样弄个 codesandbox 吗,你发的代码感觉有点不全~ https://codesandbox.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants