callstack / callstack/react-native-paper

Add default pointer event for Surface iOS

Đang mở
#4,101 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
feature request Surface
Ngôn ngữ chính
TypeScript
Star
14.5k
Fork
2.2k
Merge trung bình
5 ngày 23 giờ
Pull request đã merge (30 ngày)
12

Mô tả

**Is your feature request related to a problem? Please describe.**
I was making a collapsible header scrollable (For example: ScrollView, FlatList). The header is rendered with absolute style and the content of the scrollable will have a padding value based on header height. With this method of rendering I need to set `pointerEvents` prop of children of the header either to `box-none` or `none` for non-touchable component so that the header is able to receive scroll gesture. Everything was working fine until I used `Surface` component, things behaved a little different between Android and iOS:
- Android: working as expected when setting `pointerEvents` prop to `box-none` or `none`
- iOS: not working when setting `pointerEvents` prop to `box-none` or `none`

**Describe the solution you'd like**
I dig into `Surface` component source code and I found out the `SurfaceIOS` component actually renders 2 layers of View instead of 1 on other platforms. And the `pointerEvents` prop is only forwarded to the inner layer View. After I set `pointerEvents` prop of the outer layer View to `box-none` and it was working on iOS.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
image

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.