Skip to content

Commit 8b8ccea

Browse files
emily8rownmeta-codesync[bot]
authored andcommitted
Fix RCTDevLoadingView banner interaction (#54706)
Summary: Pull Request resolved: #54706 Changelog: [iOS][Fixed] - remove redundant gesture to tap button when the layer beneath is already tappable The dismiss button had a redundant tap handler when the entire banner was already tappable. **Redundant button interaction**: The dismiss button's `primaryAction` was removed and `userInteractionEnabled` is set to `NO`, making it purely visual. Taps on the button now pass through to the banner's tap gesture recognizer. Reviewed By: vzaidman Differential Revision: D87927449 fbshipit-source-id: af7dabff6f2ea23124d44bd21e82c789176f3acf
1 parent f973543 commit 8b8ccea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/react-native/React/CoreModules/RCTDevLoadingView.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,9 @@ - (void)showMessage:(NSString *)message
158158
buttonConfig.background.cornerRadius = 10;
159159
buttonConfig.baseForegroundColor = color;
160160

161-
UIAction *dismissAction = [UIAction actionWithHandler:^(__kindof UIAction *_Nonnull action) {
162-
[self hide];
163-
}];
164-
self->_dismissButton = [UIButton buttonWithConfiguration:buttonConfig primaryAction:dismissAction];
161+
// Button is a visual cue to tap anywhere on the banner to dismiss so no seperate action is needed
162+
self->_dismissButton = [UIButton buttonWithConfiguration:buttonConfig primaryAction:nil];
163+
self->_dismissButton.userInteractionEnabled = NO;
165164
self->_dismissButton.translatesAutoresizingMaskIntoConstraints = NO;
166165

167166
// Prevent button from being compressed - force label to wrap instead

0 commit comments

Comments
 (0)