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

ios系统下外层盒子设置了圆角,overflow: hidden; swipe组件切换时,会把圆角失效后,切换完成,又变回圆角 #9931

Closed
5SUPERMAN opened this issue Nov 24, 2021 · 4 comments

Comments

@5SUPERMAN
Copy link

重现链接

https://testact.udaer.net/famousProductIntegralIndex

Vant 版本

^2.12.29

描述一下你遇到的问题。

ios系统下外层盒子设置了圆角,并且overflow: hidden;
但是swipe组件切换时,会把圆角失效后,切换完成后,又变回圆角

重现步骤

swipe切换时出现

设备/浏览器

ios系统的手机

chenjiangui added a commit to chenjiangui/vant that referenced this issue Nov 24, 2021
chenjiahan added a commit that referenced this issue Nov 25, 2021
* fix(Swipe): issue #9931 `overflow` lose efficacy in  ios/safari

* Update index.less

Co-authored-by: neverland <chenjiahan@buaa.edu.cn>
@chenjiahan chenjiahan added this to the 2.12.35 milestone Nov 25, 2021
@xiaobeifeng
Copy link

可以注意下层级和 css 的设置问题,你参考下我的

.m-banner {
  margin: 8px 8px 8px 8px;
  overflow: hidden;
  border-radius: 5px;
  &-swipe {
    transform: translateY(0);
    border-radius: 5px;
    &-item {
      background-color: white;
    }
  }
}
<div class="m-banner">
        <van-swipe
          class="m-banner-swipe"
          :autoplay="3000"
          duration="1000"
          indicator-color="#1E8BF6"
          height="180"
        >
          <van-swipe-item
            class="m-banner-swipe-item"
            v-for="item in bannerList"
            :key="item.id"
            @click="swipeClick(item)"
          >
            <van-image fit="fill" :src="item.imageUrl" height="180px" width="100%" />
          </van-swipe-item>
        </van-swipe>
      </div>

@chenjiahan
Copy link
Member

已在 2.12.35 版本修复

@5SUPERMAN
Copy link
Author

已在 2.12.35 版本修复

好的,麻烦了!

@5SUPERMAN
Copy link
Author

可以注意下层级和 css 的设置问题,你参考下我的

.m-banner {
  margin: 8px 8px 8px 8px;
  overflow: hidden;
  border-radius: 5px;
  &-swipe {
    transform: translateY(0);
    border-radius: 5px;
    &-item {
      background-color: white;
    }
  }
}
<div class="m-banner">
        <van-swipe
          class="m-banner-swipe"
          :autoplay="3000"
          duration="1000"
          indicator-color="#1E8BF6"
          height="180"
        >
          <van-swipe-item
            class="m-banner-swipe-item"
            v-for="item in bannerList"
            :key="item.id"
            @click="swipeClick(item)"
          >
            <van-image fit="fill" :src="item.imageUrl" height="180px" width="100%" />
          </van-swipe-item>
        </van-swipe>
      </div>

加上这个transform: translateZ(0); 就可以了

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