Skip to content

Commit 7b1183d

Browse files
Feat/ from i os rn79 sidemenu visible #8068 (#8166)
* initial commit * AppDelegate updates * RNNAppDelegate update * RNNAppDelegate update * update scripts * sim updates * podspec update * Upgraded to latest version React Native * Added new pipelines * Added new pipelines * Disable autolink test * device downgrade * Disabled tests * script update * Rename .java to .kt * Fixed roboletric tests * update scripts * Reenable tests * update scripts * update podspec * and again * cleanup * headers for tests to run in xcode * test updates to aline with iOS 18 * podspec update * reanimated update for RN0.79 * link test update for iOS * android linker test templates added * snapshot update for linker test * update for linnker test and podspec * remove old snap test * Documentation update * update in docs * Better documentation * cleanup * sidemenu fix for when sending width #8068 * cleanup * Added test --------- Co-authored-by: Georgy Steshin <gosha212@gmail.com>
1 parent 4b5ca29 commit 7b1183d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ios/RNNSideMenu/MMDrawerController/MMDrawerController.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,12 @@ - (void)closeDrawerInOverlayMode:(UIViewController *)sideDrawerViewController
387387
[self.centerContainerView bringSubviewToFront:self.centerContentOverlay];
388388
self.centerContentOverlay.alpha = 0.5;
389389
}
390-
390+
391+
//Reset the centerContainerView frame if it deviated
392+
if (self.centerContainerView.frame.origin.x == visibleSide == MMDrawerSideLeft ? _maximumLeftDrawerWidth : _maximumRightDrawerWidth) {
393+
[self.centerContainerView setFrame:self.childControllerContainerView.bounds];
394+
}
395+
391396
CGFloat distance = ABS(currentFrame.origin.x - finalFrame.origin.x);
392397
NSTimeInterval duration = [self animationDurationForDistance:distance velocity:velocity];
393398

playground/e2e/SideMenu.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Utils from './Utils';
22
import TestIDs from '../src/testIDs';
3+
import jestExpect from 'expect';
34

45
const {elementByLabel, elementById, expectImagesToBeEqual} = Utils;
56

@@ -90,6 +91,17 @@ describe('SideMenu', () => {
9091
await elementById('SideMenuContainer').takeScreenshot(`side_menu_${openMode}`);
9192
expectImagesToBeEqual(actual, snapshottedImagePath);
9293
});
94+
95+
it.e2e(':ios: center container should reset to full width after push and close', async () => {
96+
await elementById(TestIDs.OPEN_LEFT_SIDE_MENU_BTN).tap();
97+
await elementById(TestIDs.LEFT_SIDE_MENU_PUSH_AND_CLOSE_BTN).tap();
98+
await elementById(TestIDs.POP_BTN).tap();
99+
const containerAttrs = await elementById('SideMenuContainer').getAttributes();
100+
const containerWidth = containerAttrs.frame.width;
101+
const centerAttrs = await elementById(TestIDs.SIDE_MENU_CENTER_SCREEN_CONTAINER).getAttributes();
102+
const centerWidth = centerAttrs.frame.width;
103+
jestExpect(centerWidth).toBe(containerWidth);
104+
});
93105
});
94106

95107
it.e2e(':ios: should open above-content by default', async () => {

0 commit comments

Comments
 (0)