Add ObjC feature flag for dispatching w3c pointer events

Summary: Changelog: [Internal] Set up iOS feature flag for w3c pointer event dispatch

Reviewed By: lunaleaps

Differential Revision: D35233280

fbshipit-source-id: de439d9bbad4d5d2010a8ca3b99dd46c9a33946c
This commit is contained in:
Vincent Riemer
2022-04-07 14:07:58 -07:00
committed by Facebook GitHub Bot
parent cf2d05c4fe
commit e85f2e2547
3 changed files with 25 additions and 0 deletions
+6
View File
@@ -15,3 +15,9 @@ RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollec
*/
RCT_EXTERN BOOL RCTExperimentGetPreemptiveViewAllocationDisabled(void);
RCT_EXTERN void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value);
/*
* W3C Pointer Events
*/
RCT_EXTERN BOOL RCTGetDispatchW3CPointerEvents(void);
RCT_EXTERN void RCTSetDispatchW3CPointerEvents(BOOL value);
+15
View File
@@ -24,3 +24,18 @@ void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value)
{
RCTExperimentPreemptiveViewAllocationDisabled = value;
}
/*
* W3C Pointer Events
*/
static BOOL RCTDispatchW3CPointerEvents = NO;
BOOL RCTGetDispatchW3CPointerEvents()
{
return RCTDispatchW3CPointerEvents;
}
void RCTSetDispatchW3CPointerEvents(BOOL value)
{
RCTDispatchW3CPointerEvents = value;
}
+4
View File
@@ -269,6 +269,10 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
RCTExperimentSetPreemptiveViewAllocationDisabled(YES);
}
if (reactNativeConfig && reactNativeConfig->getBool("rn_convergence:dispatch_pointer_events")) {
RCTSetDispatchW3CPointerEvents(YES);
}
auto componentRegistryFactory =
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
EventDispatcher::Weak const &eventDispatcher, ContextContainer::Shared const &contextContainer) {