diff --git a/components/cascader/cascader.component.ts b/components/cascader/cascader.component.ts index 41e4505b37..b2530d54f2 100644 --- a/components/cascader/cascader.component.ts +++ b/components/cascader/cascader.component.ts @@ -365,10 +365,9 @@ export class NzCascaderComponent implements NzCascaderComponentAsSource, OnInit, // These operations would not mutate data. this.checkChildren(); this.setDisplayLabel(); + this.cdr.detectChanges(); this.reposition(); this.setDropdownStyles(); - - this.cdr.markForCheck(); }); srv.$loading.pipe(takeUntil(this.destroy$)).subscribe(loading => { @@ -587,6 +586,7 @@ export class NzCascaderComponent implements NzCascaderComponentAsSource, OnInit, if (option && option.disabled) { return; } + this.el.focus(); this.inSearchingMode ? this.cascaderService.setSearchOptionSelected(option as NzCascaderSearchOption) @@ -711,6 +711,7 @@ export class NzCascaderComponent implements NzCascaderComponentAsSource, OnInit, if (this.overlay && this.overlay.overlayRef && this.menuVisible) { Promise.resolve().then(() => { this.overlay.overlayRef.updatePosition(); + this.cdr.markForCheck(); }); } } diff --git a/components/cascader/cascader.service.ts b/components/cascader/cascader.service.ts index 3dad28c3b6..e89b7812f0 100644 --- a/components/cascader/cascader.service.ts +++ b/components/cascader/cascader.service.ts @@ -173,7 +173,6 @@ export class NzCascaderService implements OnDestroy { if (option.disabled) { return; } - this.activatedOptions[columnIndex] = option; this.trackAncestorActivatedOptions(columnIndex); this.dropBehindActivatedOptions(columnIndex); diff --git a/components/core/overlay/overlay-position.ts b/components/core/overlay/overlay-position.ts index f9c7a9a4fe..4ca5ab08c0 100644 --- a/components/core/overlay/overlay-position.ts +++ b/components/core/overlay/overlay-position.ts @@ -44,7 +44,9 @@ export const DEFAULT_CASCADER_POSITIONS = [ POSITION_MAP.bottomLeft, POSITION_MAP.bottomRight, POSITION_MAP.topLeft, - POSITION_MAP.topRight + POSITION_MAP.topRight, + POSITION_MAP.topCenter, + POSITION_MAP.bottomCenter ]; export const DEFAULT_MENTION_TOP_POSITIONS = [ diff --git a/components/tooltip/doc/index.zh-CN.md b/components/tooltip/doc/index.zh-CN.md index 1b6493fe6e..42b0846d26 100644 --- a/components/tooltip/doc/index.zh-CN.md +++ b/components/tooltip/doc/index.zh-CN.md @@ -27,7 +27,7 @@ import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; | `[nzTooltipArrowPointAtCenter]` | 箭头指向锚点的中心 | `boolean` | `false` | | `[nzTooltipTitle]` | 提示文字 | `string \| TemplateRef` | - | | `[nzTooltipTitleContext]` | 提示文字模板上下文 | `object` | - | -| `[nzTooltipTrigger]` | 触发行为,可选 `hover/focus/click`,为 `null` 时不响应光标事件 | `'click' \| 'focus' \| 'hover' \| null` | `'hover'` | +| `[nzTooltipTrigger]` | 触发行为,可选 `hover` \| `focus` \| `click`,为 `null` 时不响应光标事件 | `'click' \| 'focus' \| 'hover' \| null` | `'hover'` | | `[nzTooltipPlacement]` | 气泡框位置 | `'top' \| 'left' \| 'right' \| 'bottom' \| 'topLeft' \| 'topRight' \| 'bottomLeft' \| 'bottomRight' \| 'leftTop' \| 'leftBottom' \| 'rightTop' \| 'rightBottom' \| Array` | `'top'` | | `[nzTooltipColor]` | 背景颜色 | `string` | - | | `[nzTooltipOrigin]` | 气泡框定位元素 | `ElementRef` | - |