Skip to content

Commit 0d20140

Browse files
committed
fix extra trigger div
1 parent dd63071 commit 0d20140

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/SubMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ export class SubMenu extends React.Component<SubMenuProps> {
613613
getPopupContainer={getPopupContainer}
614614
builtinPlacements={placement}
615615
popupPlacement={popupPlacement}
616-
popupVisible={isOpen}
616+
popupVisible={isInlineMode ? false : isOpen}
617617
popupAlign={popupAlign}
618618
popup={isInlineMode ? null : children}
619619
action={(disabled || isInlineMode) ? [] : [triggerSubMenuAction]}

tests/SubMenu.spec.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ describe('SubMenu', () => {
483483

484484
title.simulate('click');
485485
jest.runAllTimers();
486-
expect(wrapper.find('CSSMotion').at(1).prop('motionName')).toEqual('fade');
486+
expect(wrapper.find('CSSMotion').prop('motionName')).toEqual('fade');
487487
});
488488

489489
it('should not animate on initially opened menu', () => {
@@ -516,12 +516,7 @@ describe('SubMenu', () => {
516516
title.simulate('click');
517517
jest.runAllTimers();
518518

519-
expect(
520-
wrapper
521-
.find('CSSMotion')
522-
.at(1)
523-
.prop('motionAppear'),
524-
).toBeTruthy();
519+
expect(wrapper.find('CSSMotion').prop('motionAppear')).toBeTruthy();
525520
});
526521
});
527522

0 commit comments

Comments
 (0)