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

[bug-report] swiper组件在屏幕resize的时候会发生重绘,返回第一页 #596

Closed
exkings opened this issue Oct 16, 2019 · 1 comment
Assignees
Labels
optimizing Optimize performance or experience

Comments

@exkings
Copy link

exkings commented Oct 16, 2019

Mand Mobile Version

2.4.1

Vue Version

2.6.1 ts

Model / OS & Browser Info

Recurring Steps

swiper用为登陆页的落地页展示
1.点击Input(onFocus)弹出键盘同时触发stop(),此时需要停止swiper滑动
2.当Input(onBlur)时触发play()继续之前的滚动

更简单的复现为在文档官网的swiper的demo页面改变浏览器大小,同样会触发

Expectant Behaviors

onFocus的时候swiper 触发 stop事件,停留在当前滑动的页

Actual Behaviors

在步骤1时,onFocus的时候swiper会发生重绘返回第一页,然后才停止

@xxyan0205 xxyan0205 added the optimizing Optimize performance or experience label Oct 17, 2019
@exkings
Copy link
Author

exkings commented Oct 17, 2019

昨天翻了下源码,发现是对resize事件做了监听然后对swiper做了init,目前我的处理是在挂载的时候对$_resize事件进行重写,但是有些别扭,或者可以加一个可配置项,希望能再优化下吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimizing Optimize performance or experience
Projects
None yet
Development

No branches or pull requests

3 participants