Skip to content

Fix pointerEvents, other props on SafeAreaView not working on Android#130

Merged
janicduplessis merged 1 commit intoAppAndFlow:masterfrom
hsource:harry-pointer-events
Aug 6, 2020
Merged

Fix pointerEvents, other props on SafeAreaView not working on Android#130
janicduplessis merged 1 commit intoAppAndFlow:masterfrom
hsource:harry-pointer-events

Conversation

@hsource
Copy link
Copy Markdown
Contributor

@hsource hsource commented Jul 26, 2020

Summary

Because SafeAreaViewManager extends ViewGroupManager, some props on <View> that are handled by ReactViewManager and other classes that extend ViewGroupManager aren't handled. Notably, this includes pointerEvents, which can be used to make the SafeAreaView ignore taps when it's used as an overlay.

Test Plan

I installed a branch containing the fix to my own app.

To test this, create an instance of <SafeAreaView style={{ flex: 1 }} pointerEvents="box-none"> that overlays a button or map. The button should be tappable and the map should be pannable.

Before After
Before After

Copy link
Copy Markdown
Collaborator

@janicduplessis janicduplessis left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the fix

@Willham12
Copy link
Copy Markdown

@janicduplessis seems we have the same issue with 4.1.2

@janicduplessis
Copy link
Copy Markdown
Collaborator

I see, we’re no longer extending ReactViewGroupManager in 4.0, and it seems a bit harder to do now with support for new architecture, I’ll have a look.

@janicduplessis
Copy link
Copy Markdown
Collaborator

@Willham12 Should be fixed in 4.1.4

@account-mhj
Copy link
Copy Markdown

account-mhj commented Feb 20, 2023

@janicduplessis SafeAreaProvider has same problems. Properties like pointerEvent wil not work unless replacing ViewGroupManager by ReactViewManager in SafeAreaProviderManager .

@chj-damon
Copy link
Copy Markdown

@janicduplessis SafeAreaProvider has same problems. Properties like pointerEvent wil not work unless replacing ViewGroupManager by ReactViewManager in SafeAreaProviderManager .
@janicduplessis would you mind take a loot at this?

@chj-damon
Copy link
Copy Markdown

@account-mhj have you solved this problem?

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.

5 participants