Skip to content

Commit

Permalink
Fixes Dev menu pop up multiple times when Tap command D continuously (
Browse files Browse the repository at this point in the history
#41234)

Summary:
Fixes Dev menu pop up multiple times when Tap command `D` continuously, demo like below:
https://github.com/facebook/react-native/assets/5061845/b4c2b38d-ece6-4d4e-a823-23eaa7cad001

## Changelog:

[IOS] [FIXED] - Fixes Dev menu pop up multiple times when Tap command `D` continuously

Pull Request resolved: #41234

Test Plan: Press `D` continuously, the menu pop up and dismiss correctly.

Reviewed By: cipolleschi

Differential Revision: D50925959

Pulled By: blakef

fbshipit-source-id: 50fac9b4cea94c15a06ebc1b6092ebc9909cd9d2
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Nov 2, 2023
1 parent d6163d7 commit a257e9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-native/React/CoreModules/RCTDevMenu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ - (void)showOnShake

- (void)toggle
{
if (_actionSheet.isBeingPresented || _actionSheet.beingDismissed) {
return;
}
if (_actionSheet) {
[_actionSheet dismissViewControllerAnimated:YES
completion:^(void){
completion:^(void) {
self->_actionSheet = nil;
}];
_actionSheet = nil;

} else {
[self show];
}
Expand Down

0 comments on commit a257e9f

Please sign in to comment.