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]Fixed the problem that the list was not automatically restored when the loading tag was pulled up under certain conditions #3300

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

yuditxj
Copy link
Contributor

@yuditxj yuditxj commented May 24, 2022

Fix the problem that when the list is under one piece of data, the loading label will be displayed by default in the drop-down refresh list

复现条件:
list标签数据不超过一屏时,同时存在refresh和loading标签,若上拉加载列表(没有更多数据),仅仅快速切换(100ms)loading标签的display属性由true为false,发现列表位置不会自动还原

原因:
Probably setContentOffset: has higher priority than setContentOffset:animated:

方案:
参考refresh标签的说明,针对displayState字段不同值,调整设置setContentOffset方式

Brief Description of the PR

Checklist

Refreshing ... {{num}} Loading ... <script> const modal = weex.requireModule('modal') export default { data () { return { refreshing: false, loadinging: false, lists: [1, 2, 3, 4, 5] } }, methods: { onrefresh (event) { modal.toast({ message: 'Refreshing', duration: 1 }) this.refreshing = true setTimeout(() => { this.refreshing = false }, 2000) }, onpullingdown (event) { console.log("dy: " + event.dy) console.log("pullingDistance: " + event.pullingDistance) console.log("viewHeight: " + event.viewHeight) console.log("type: " + event.type) }, onloading (event) { modal.toast({ message: 'Loading', duration: 1 }) this.loadinging = true setTimeout(() => { this.loadinging = false }, 2000) }, } } </script> <style scoped> .refresh { width: 750px; height: 180px; background-color: #333; display: -ms-flex; display: -webkit-flex; display: flex; -ms-flex-align: center; -webkit-align-items: center; -webkit-box-align: center; align-items: center; } .indicator-text { color: #EEE; font-size: 42px; text-align: center; } .indicator { margin-top: 16px; height: 40px; width: 40px; color: blue; } .panel { width: 600px; height: 250px; margin-left: 75px; margin-top: 35px; margin-bottom: 35px; flex-direction: column; justify-content: center; border-width: 2px; border-style: solid; border-color: #DDDDDD; background-color: #F5F5F5; } .text { font-size: 50px; text-align: center; color: #41B883; } </style>
  • Documentation:

…hen the loading tag was pulled up under certain conditions

复现条件:
list标签数据不超过一屏时,同时存在refresh和loading标签,若上拉加载列表(没有更多数据),仅仅快速切换(100ms)loading标签的display属性由true为false,发现列表位置不会自动还原

原因:
Probably setContentOffset: has higher priority than setContentOffset:animated:

方案:
参考refresh标签的说明,针对displayState字段不同值,调整设置setContentOffset方式
@yuditxj yuditxj changed the title Fix the problem that when the list is under one piece of data, the loading label will be displayed by default in the drop-down refresh list [ios]Fix the problem that when the list is under one piece of data, the loading label will be displayed by default in the drop-down refresh list May 24, 2022
@Txink
Copy link
Collaborator

Txink commented May 24, 2022

麻烦合并一下PR,还有就是能提供一个验证demo么

@yuditxj yuditxj changed the title [ios]Fix the problem that when the list is under one piece of data, the loading label will be displayed by default in the drop-down refresh list [ios]Fixed the problem that the list was not automatically restored when the loading tag was pulled up under certain conditions May 25, 2022
@yuditxj
Copy link
Contributor Author

yuditxj commented May 25, 2022

麻烦合并一下PR,还有就是能提供一个验证demo么
demo地址:
http://dotwe.org/vue/ab6efd1b38c9beaec2cae3a99e3ecf79

Copy link
Collaborator

@Txink Txink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Txink Txink merged commit 8f3f2b7 into alibaba:master Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants