-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 13.4 下 bounce 存在异常 #978
Comments
今天刚升级的iOS版本就坏了,昨天还好好的 |
就是iOS 13.4 才会出现的,我现在也遇到了,项目生产环境在用着。急!请问有解决办法吗 |
@tanlucheng 是在什么浏览器下面,微信还是safari? |
@xiaojun1994 @tanlucheng 我测试了一下,是在iOS 13.4 && wkwebview 的情况下,会出现这个情况,目前的解决方案就是根据 ua 在实例化 bs 的时候传入关闭 bounce 的配置。 {
bounce: {
top: false,
bottom: false
}
} |
或者还有另外一种方案,默认采取 {
useTransition: false
} |
目前 wkwebview 是存在许多bug,我在实际的公司业务中也是遇到很多问题 |
目前选择优雅降级的方式,判断在iOS 13.4版本 设置bounce为false!
…------------------ 原始邮件 ------------------
发件人: "JiZhi"<notifications@github.com>;
发送时间: 2020年4月2日(星期四) 下午2:09
收件人: "ustbhuangyi/better-scroll"<better-scroll@noreply.github.com>;
抄送: "谭露成"<759908111@qq.com>; "Mention"<mention@noreply.github.com>;
主题: Re: [ustbhuangyi/better-scroll] iOS 13.4 下 bounce 存在异常 (#978)
目前 wkwebview 是存在许多bug,我在实际的公司业务中也是遇到很多问题
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
先给个大致的思路: |
上面是从我的react组件中剥离出来的逻辑(简化版),此段代码没测试过,大致逻辑是这样的。 |
同事的今天也说了这个问题,也能复现,13.4的ios |
根据@jemmy-tang的思路,整理的我的解决方法: let bScrollInstance = null;
let loadFinish = false; // 数据是否全部加载完成 当你调用closePullUp()函数时把loadFinish的值修改为true。
init();
function init() {
bScrollInstance = new BScroll('#wrapper', {
scrollY: true,
click: true,
pullDownRefresh: {
threshold: 90,
stop: 30
},
pullUpLoad: {
threshold: 30
}
});
// 当下拉距离达到 threshold 配置的值时触发
bScrollInstance.on('pullingDown', pullingDownHandler);
bScrollInstance.on('pullingUp', pullingUpHandler);
bScrollInstance.on('scroll', scrollHandler);
}
function scrollHandler(e) {
let y = e.y;
// your code
if(is_IOS_13_4()) {
handleIOS_13_4_Shade(y);
}
}
function pullingDownHandler(e) {
// your code
}
function pullingUpHandler(e) {
// your code
// 当数据全部加载完成之后记得调用closePullUp()函数 关闭上拉加载
}
function is_IOS_13_4() {
let verNum = 0;
let reg = /OS (\d+[\_\d]+)/g;
let isIos = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isIos) {
let iosVer = navigator.appVersion;
let ver = reg.exec(iosVer)[1];
let verArr = ver.split('_');
for(let i = 0; i < verArr.length; i++) {
if(i !== 0) {
verNum += parseInt(verArr[i]) * 1 / Math.pow(10,i);
} else {
verNum += parseInt(verArr[i]);
}
}
verNum = Math.round(verNum * 100) / 100;
console.log(verNum);
}
return isIos && verNum >= 13.4;
}
function handleIOS_13_4_Shade(y) {
// 解决ios13.4版本下滚动到顶部时列表的抖动问题 -- 下滑
if(bScrollInstance.movingDirectionY === -1 && (y < 0 && y > -20)) {
bScrollInstance.scrollTo(0,0,0);
}
// 解决ios13.4版本下滚动到底部时列表的抖动问题 -- 上滑
if (loadFinish && (y - bScrollInstance.maxScrollY) < 20) {
bScrollInstance.scrollTo(0, bScrollInstance.maxScrollY, 0);
}
} |
请问解决了么 |
测试:更新到2.0.4修复 |
不会是你的手机升级了ios14的原因吧 |
没修复,而且很多浏览器都有问题,用的raf,并且关了回弹功能,滑得愉快还是弹 |
Version
1.15.2
Reproduction link
http://ustbhuangyi.com/music/#/recommend
Steps to reproduce
快速滑动,当触发bounce时,你会看到 list 大跳一下,请参考你们官方播放器 demo (http://ustbhuangyi.com/music/#/recommend)
What is expected?
正常弹回
What is actually happening?
bounce渲染异常
我本地能复现,并不是官方 demo 个例
The text was updated successfully, but these errors were encountered: