-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix:disableScroll属性为false时还原css #436
base: master
Are you sure you want to change the base?
Conversation
改下版本号 |
@@ -257,6 +257,8 @@ const ScrollView: ForwardRefExoticComponent<ScrollViewProps> = forwardRef( | |||
|
|||
if (disableScroll) { | |||
scrollerStyle.overflow = 'hidden'; | |||
} else { | |||
scrollerStyle.overflow = 'scroll'; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里逻辑有覆盖问题吧,上面设置的 overflowX/overflowY
都会被覆盖掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个覆盖关系还是有问题吧,disableScroll
没生效了吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗷嗷,刚开始嵌套这写的,我加上去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这边改完了啊,有时间看一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
复现场景:disableScroll先设置为true,再设置为false,不生效;
更改逻辑:原有代码缺少disableScroll为false的处理,因为直接加处理会覆盖horizontal,所以先判断disableScroll再判断horizontal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原有逻辑是:
首次设置 disableScroll=true 后,
scrollerStyle 的值为: {overflow:'hidden'}
再次设置 disableScroll=false 后,scrollerStyle 的值分两种场景
- 如果 horizontal 为true 值为 {overflowX: 'scroll', overflowY:' hidden'}
- 如果 horizontal 为false 值为 {overflowX: 'hidden', overflowY:'scroll'}
这个结果有什么问题吗?期望是怎么样的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这边看到了问题,我第二次重置为false,组件上并没有设置overflow,因为overflow的默认值是visible,所以滚动不生效了
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余的空行删除下
No description provided.