-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RN: Add Support for
overflow
on Android (Take 2)
Summary: Adds support for the `overflow` style property on React Native for Android. This is the second attempt to do this. See 6110a4c (D8666509) for the first attempt. Similar to the first attempt, this sets `setClipChildren(false)` by default on all `ViewGroup` instances. However, this differs in how it implements `overflow: hidden`. Instead of conditionally setting `setClipChildren`, this manually clips children to the `ViewGroup`'s bounds (which was incidentally what we were doing for background + border radius already). Reviewed By: achen1 Differential Revision: D8690805 fbshipit-source-id: 58757825cd9d138c18c8758918d85b4ca1915f87
- Loading branch information
1 parent
cfce6ee
commit b81c8b5
Showing
2 changed files
with
19 additions
and
12 deletions.
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
b81c8b5
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.
“Finally!”
b81c8b5
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.
Is it just me or it doesn't work with 0.56?
Hmm, I guess it did not make it there.
Anyway, does this take care of touches on out-of-bounds views?
b81c8b5
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.
0.56 was cut mid-June, long before this commit :)
b81c8b5
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.
@yungsters thanks so much! I am really excited to see this! however I am having trouble implementing this. Is there any set up required or is it just adding overflow: visible to the parent?
b81c8b5
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.
@reganperkins it's easy for us to miss comments on commits. You can try asking Tim on twitter.
b81c8b5
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.
Overflow visible is working. But, the overflowed absolute view is not touchable in android.
b81c8b5
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.
@qalqi #26374
b81c8b5
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.
@qalqi Did you find any solution for this?
b81c8b5
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.
This doesn't work when using renderToHardwareTextureAndroid -- with that property set subviews always get clipped
b81c8b5
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.
This doesn't work when using scrollview in horizontal mode, any solutions ?
b81c8b5
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.
ScrollView still clips its children even with overflow: 'visible' RN 0.62
b81c8b5
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.
Possible workaround for ScrollView clipping:
b81c8b5
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.
Still not working in RN 0.64
b81c8b5
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.
overflow: visible
does not work on android for<ScrollView />
or<FlatList />
. It clips children view.iOS:
Android:
b81c8b5
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.
Try to add overflow style to the grandparent view. Or just add padding to the scrollview the same size as the shadow.
b81c8b5
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.
@danielgindi I think that this is not the intended behavior. Most of users expect that
overflow
inScrollView
andFlatList
in Android should work as how in iOS does (as @matinzd pointed out).b81c8b5
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.
Is there any solution to make this work with SectionList or FlatList ? I see its still not supported :(
b81c8b5
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.
Why is this lame issue still open in 2024? Doesn't make sense to continue using React native.
b81c8b5
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.
Hmm, so still not working until now?