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

Carousel自动切换和手动切换冲突 #1259

Closed
forget1 opened this issue Sep 21, 2022 · 3 comments
Closed

Carousel自动切换和手动切换冲突 #1259

forget1 opened this issue Sep 21, 2022 · 3 comments

Comments

@forget1
Copy link

forget1 commented Sep 21, 2022

Reproduction link

https://1uokun.github.io/ant-design-mobile-rn/index.html

Steps to reproduce

官网示例在移动端打开,打开自动切换。手动切换的时候在一轮结束到第一张的时候会卡一下,然后偶尔会从第三张图直接切到第5张

What is expected?

手动切换的时候,暂停自动切换逻辑

What is actually happening?

手动切换时,自动切换还在继续

Environment Info
antd 2.3.1
React 0.45.0
System 安卓12
Browser RN
@forget1
Copy link
Author

forget1 commented Sep 21, 2022

<Carousel
   autoplay={true}
   autoplayInterval={5000}
   infinite
>
  {categories.items.map((item, index) =>{
    return (
      <TouchableOpacity key={index} activeOpacity={1} style={{width: '100%', height: 150, position: 'relative', justifyContent: 'center', alignItems: 'center'}} onPress={() => Actions.bulletin({id: item.id, partnerCode: partners.currentPartner.code})}>
         <Image style={{width:'100%',height:'100%'}} source={IMAGES[item.banner.content_id - 1]} resizeMethod='resize'></Image>
         <Text style={{position: 'absolute', fontSize: 20, backgroundColor: 'transparent', color: `${item.banner.color}`, fontWeight: '500'}}>{item.title}</Text>
       </TouchableOpacity>
    )})}
</Carousel>

本地相关代码如上

@EaveLuo
Copy link

EaveLuo commented Sep 6, 2024

这个问题两年依然存在。。。。

@1uokun
Copy link
Collaborator

1uokun commented Sep 9, 2024

fixed in 5.2.3

@1uokun 1uokun closed this as completed Sep 9, 2024
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