diff --git a/components/menu/submenu.component.ts b/components/menu/submenu.component.ts index d8c2642443b..830a337a320 100644 --- a/components/menu/submenu.component.ts +++ b/components/menu/submenu.component.ts @@ -42,7 +42,14 @@ import { NzIsMenuInsideDropDownToken } from './menu.token'; import { NzMenuModeType, NzMenuThemeType } from './menu.types'; import { NzSubmenuService } from './submenu.service'; -const listOfVerticalPositions = [POSITION_MAP.rightTop, POSITION_MAP.rightBottom, POSITION_MAP.leftTop, POSITION_MAP.leftBottom]; +const listOfVerticalPositions = [ + POSITION_MAP.rightTop, + POSITION_MAP.right, + POSITION_MAP.rightBottom, + POSITION_MAP.leftTop, + POSITION_MAP.left, + POSITION_MAP.leftBottom +]; const listOfHorizontalPositions = [POSITION_MAP.bottomLeft]; @Component({ @@ -179,9 +186,9 @@ export class NzSubMenuComponent implements OnInit, OnDestroy, AfterContentInit, onPositionChange(position: ConnectedOverlayPositionChange): void { const placement = getPlacementName(position); - if (placement === 'rightTop' || placement === 'rightBottom') { + if (placement === 'rightTop' || placement === 'rightBottom' || placement === 'right') { this.position = 'right'; - } else if (placement === 'leftTop' || placement === 'leftBottom') { + } else if (placement === 'leftTop' || placement === 'leftBottom' || placement === 'left') { this.position = 'left'; } this.cdr.markForCheck();