Skip to content

Commit

Permalink
fix(abc:reuse-tab): fix invalid context menu, close #104
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jun 15, 2018
1 parent ee0f00d commit ce899ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/abc/reuse-tab/reuse-tab-context.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, ElementRef } from '@angular/core';
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
import { ComponentPortal } from '@angular/cdk/portal';
import { Subscription, Subject } from 'rxjs';
Expand Down Expand Up @@ -32,7 +32,7 @@ export class ReuseTabContextService {
open(context: ReuseContextEvent) {
this.remove();
const { event, item } = context;
const fakeElement = {
const fakeElement = new ElementRef({
getBoundingClientRect: (): ClientRect => ({
bottom: event.clientY,
height: 0,
Expand All @@ -41,11 +41,11 @@ export class ReuseTabContextService {
top: event.clientY,
width: 0,
}),
};
});
const positionStrategy = this.overlay
.position()
.connectedTo(
{ nativeElement: fakeElement },
fakeElement,
{ originX: 'start', originY: 'bottom' },
{ overlayX: 'start', overlayY: 'top' },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('form: widget: autocomplete', () => {
.checkCount('nz-auto-option', data.length)
.click('nz-auto-option')
.checkValue('a', `aaa`)
.asyncEnd(50);
.asyncEnd(500);
}),
);
it('with async data', () => {
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('form: widget: autocomplete', () => {
.checkCount('nz-auto-option', 1)
.typeChar('a11')
.checkCount('nz-auto-option', 1)
.asyncEnd(50);
.asyncEnd(500);
}),
);
});
Expand Down

0 comments on commit ce899ba

Please sign in to comment.