Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 63fdadb

Browse files
committed
Merge branch 'release-candidate' into stable
2 parents c6d2c8c + 118e0cc commit 63fdadb

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ In this major release, we deleted the `rippleAllowsSelection` property from MDCC
44

55
## API changes
66

7-
`rippleAllowsSelection` has been deleted from MDCChipView.
7+
* Chips: `rippleAllowsSelection` has been deleted from MDCChipView.
8+
* NavigationDrawer: `shouldDismissOnAccessibilityPerformEscape` property added to allow VoiceOver users to dismiss the Navigation Drawer using the VoiceOver dismiss gesture.
89

910
## Component changes
1011

@@ -14,6 +15,7 @@ In this major release, we deleted the `rippleAllowsSelection` property from MDCC
1415

1516
## Multi-component changes
1617

18+
* [Optional dismiss on accessibilityPerformEscape.](https://github.com/material-components/material-components-ios/commit/e79fd9b19188be0a23263e3f0c5dc11105534412) (Nobody)
1719
* [Add containerRadius support to filled text field](https://github.com/material-components/material-components-ios/commit/0907c196231629d9af7e86feeed86748ec96a20f) (Andrew Overton)
1820
* [Internal change](https://github.com/material-components/material-components-ios/commit/9f62e64603adc68475ee3d21981dd79cdaff1129) (Yarden Eitan)
1921

components/NavigationDrawer/src/MDCBottomDrawerViewController.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@
115115
*/
116116
@property(nonatomic, assign) BOOL dismissOnBackgroundTap;
117117

118+
/**
119+
A flag allowing clients to opt-out of the drawer closing when user uses accessibility escape
120+
gesture. If set to NO, you can alternatively set an accessibility escape action by implementing the
121+
@c accessibilityPerformEscape method in your provided contentViewController.
122+
123+
@default YES The drawer dismisses on z-gesture.
124+
*/
125+
@property(nonatomic, assign) BOOL shouldDismissOnAccessibilityPerformEscape;
126+
118127
/**
119128
A flag allowing clients to opt-in to handling background touch events.
120129

components/NavigationDrawer/src/MDCBottomDrawerViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ - (void)commonMDCBottomDrawerViewControllerInit {
7171
_mdc_overrideBaseElevation = -1;
7272

7373
_dismissOnBackgroundTap = YES;
74+
_shouldDismissOnAccessibilityPerformEscape = YES;
7475
_shouldForwardBackgroundTouchEvents = NO;
7576
_shouldDisplayMobileLandscapeFullscreen = YES;
7677
_isDrawerClosed = YES;
@@ -334,6 +335,10 @@ - (void)setShouldAdjustOnContentSizeChange:(BOOL)shouldAdjustOnContentSizeChange
334335

335336
// Adds the Z gesture for dismissal.
336337
- (BOOL)accessibilityPerformEscape {
338+
if (!self.shouldDismissOnAccessibilityPerformEscape) {
339+
return NO;
340+
}
341+
337342
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
338343
return YES;
339344
}

components/NavigationDrawer/tests/unit/MDCNavigationDrawerTest.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,17 @@ - (void)testMaximumDrawerHeightBeingSetUpdatesTheUnderlyingPresentationControlle
277277
}
278278
}
279279

280+
- (void)testDefaultShouldDismissOnAccessibilityPerformEscape {
281+
// Default
282+
XCTAssertTrue([self.navigationDrawer accessibilityPerformEscape]);
283+
}
284+
285+
- (void)testSettingShouldDismissOnAccessibilityPerformEscape {
286+
// When
287+
self.navigationDrawer.shouldDismissOnAccessibilityPerformEscape = NO;
288+
289+
// Then
290+
XCTAssertFalse([self.navigationDrawer accessibilityPerformEscape]);
291+
}
292+
280293
@end

0 commit comments

Comments
 (0)