Skip to content

Commit

Permalink
fix(module:menu): fix submenu scrollable (#5155)
Browse files Browse the repository at this point in the history
close #4837
  • Loading branch information
Yadong Xie committed Apr 26, 2020
1 parent 251a064 commit fb52f21
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions components/menu/submenu.component.ts
Expand Up @@ -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({
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit fb52f21

Please sign in to comment.