mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
cf2d05c4fe
commit
e85f2e2547
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user