-
Notifications
You must be signed in to change notification settings - Fork 74
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
Open
sunwenzhe-git
wants to merge
5
commits into
raxjs:master
Choose a base branch
from
sunwenzhe-git:fix/rax-scrollview
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,18 +247,16 @@ const ScrollView: ForwardRefExoticComponent<ScrollViewProps> = forwardRef( | |
} | ||
|
||
scrollerStyle.WebkitOverflowScrolling = 'touch'; | ||
if (horizontal) { | ||
scrollerStyle.overflowX = 'scroll'; | ||
scrollerStyle.overflowY = 'hidden'; | ||
} else { | ||
scrollerStyle.overflowX = 'hidden'; | ||
scrollerStyle.overflowY = 'scroll'; | ||
} | ||
|
||
if (disableScroll) { | ||
scrollerStyle.overflow = 'hidden'; | ||
} else { | ||
scrollerStyle.overflowX = horizontal ? 'scroll' : 'hidden'; | ||
scrollerStyle.overflowY = horizontal ? 'hidden' : 'scroll'; | ||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 多余的空行删除下 |
||
|
||
const webProps = { | ||
...props | ||
}; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 的值分两种场景
这个结果有什么问题吗?期望是怎么样的?
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,所以滚动不生效了