Skip to content

Commit

Permalink
Pass "blockNativeResponder" param to RCTMountingManager
Browse files Browse the repository at this point in the history
Summary:
From looking at other implementations of setJSResponder, we need the MountingManager to have access to "blocksNativeResponder" param, but do not need to pass that through to individual views (see also Android implementation).

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D28066257

fbshipit-source-id: e1420431478fd27d2e1463e291a0bbc600d3f0a6
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Apr 29, 2021
1 parent 8eeb016 commit a249065
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion React/Fabric/Mounting/RCTMountingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)sendAccessibilityEvent:(ReactTag)reactTag eventType:(NSString *)eventType;

- (void)setIsJSResponder:(BOOL)isJSResponder forShadowView:(facebook::react::ShadowView)shadowView;
- (void)setIsJSResponder:(BOOL)isJSResponder
blockNativeResponder:(BOOL)blockNativeResponder
forShadowView:(facebook::react::ShadowView)shadowView;

- (void)synchronouslyUpdateViewOnUIThread:(ReactTag)reactTag
changedProps:(NSDictionary *)props
Expand Down
4 changes: 3 additions & 1 deletion React/Fabric/Mounting/RCTMountingManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ - (void)performTransaction:(MountingCoordinator::Shared const &)mountingCoordina
});
}

- (void)setIsJSResponder:(BOOL)isJSResponder forShadowView:(facebook::react::ShadowView)shadowView
- (void)setIsJSResponder:(BOOL)isJSResponder
blockNativeResponder:(BOOL)blockNativeResponder
forShadowView:(facebook::react::ShadowView)shadowView
{
RCTExecuteOnMainQueue(^{
UIView<RCTComponentViewProtocol> *componentView =
Expand Down
4 changes: 3 additions & 1 deletion React/Fabric/RCTScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ NS_ASSUME_NONNULL_BEGIN
- (void)schedulerDidSendAccessibilityEvent:(facebook::react::ShadowView const &)shadowView
eventType:(std::string const &)eventType;

- (void)schedulerDidSetIsJSResponder:(BOOL)isJSResponder forShadowView:(facebook::react::ShadowView const &)shadowView;
- (void)schedulerDidSetIsJSResponder:(BOOL)isJSResponder
blockNativeResponder:(BOOL)blockNativeResponder
forShadowView:(facebook::react::ShadowView const &)shadowView;

@end

Expand Down
4 changes: 3 additions & 1 deletion React/Fabric/RCTScheduler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ void schedulerDidSetIsJSResponder(ShadowView const &shadowView, bool isJSRespond
override
{
RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_;
[scheduler.delegate schedulerDidSetIsJSResponder:isJSResponder forShadowView:shadowView];
[scheduler.delegate schedulerDidSetIsJSResponder:isJSResponder
blockNativeResponder:blockNativeResponder
forShadowView:shadowView];
}

void schedulerDidSendAccessibilityEvent(const ShadowView &shadowView, std::string const &eventType) override
Expand Down
8 changes: 6 additions & 2 deletions React/Fabric/RCTSurfacePresenter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,13 @@ - (void)schedulerDidSendAccessibilityEvent:(const facebook::react::ShadowView &)
[self->_mountingManager sendAccessibilityEvent:tag eventType:eventTypeStr];
}

- (void)schedulerDidSetIsJSResponder:(BOOL)isJSResponder forShadowView:(facebook::react::ShadowView const &)shadowView;
- (void)schedulerDidSetIsJSResponder:(BOOL)isJSResponder
blockNativeResponder:(BOOL)blockNativeResponder
forShadowView:(facebook::react::ShadowView const &)shadowView;
{
[self->_mountingManager setIsJSResponder:isJSResponder forShadowView:shadowView];
[self->_mountingManager setIsJSResponder:isJSResponder
blockNativeResponder:blockNativeResponder
forShadowView:shadowView];
}

- (void)addObserver:(id<RCTSurfacePresenterObserver>)observer
Expand Down

0 comments on commit a249065

Please sign in to comment.