Skip to content

Commit caaed1b

Browse files
Nobodymaterial-automation
authored andcommitted
Inform the dialogPresentationControllerDelegate that the alert controller is dismissed when the dismissal is issued from the accessibility gesture.
PiperOrigin-RevId: 367706182
1 parent cc6266e commit caaed1b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/Dialogs/src/MDCAlertController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,15 @@ - (BOOL)accessibilityPerformEscape {
866866
MDCDialogPresentationController *dialogPresentationController =
867867
self.mdc_dialogPresentationController;
868868
if (dialogPresentationController.dismissOnBackgroundTap) {
869-
[self.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
869+
void (^dismissalCompletion)(void) = ^{
870+
if ([dialogPresentationController.dialogPresentationControllerDelegate
871+
respondsToSelector:@selector(dialogPresentationControllerDidDismiss:)]) {
872+
[dialogPresentationController.dialogPresentationControllerDelegate
873+
dialogPresentationControllerDidDismiss:dialogPresentationController];
874+
}
875+
};
876+
[self.presentingViewController dismissViewControllerAnimated:YES
877+
completion:dismissalCompletion];
870878
return YES;
871879
}
872880
return NO;

0 commit comments

Comments
 (0)