Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into toastr-fromscratch
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbaud-conorwright committed May 1, 2018
2 parents c6c847b + bdc97a6 commit ff5093c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.12.1 (2018-04-26)

- Fixed dropdown repositioning slowness. [#1655](https://github.com/blackbaud/skyux2/pull/1655)

# 2.12.0 (2018-04-23)

- Added select field component. [#1629](https://github.com/blackbaud/skyux2/pull/1629) (Thanks @Blackbaud-JaminQuimby)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blackbaud/skyux",
"version": "2.12.0",
"version": "2.12.1",
"description": "SKY UX built on Angular 2",
"author": "Blackbaud, Inc.",
"homepage": "https://github.com/blackbaud/skyux2",
Expand Down
12 changes: 6 additions & 6 deletions src/modules/dropdown/dropdown.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
async,
ComponentFixture,
fakeAsync,
TestBed,
Expand All @@ -23,19 +22,20 @@ describe('Dropdown component', () => {
let fixture: ComponentFixture<DropdownTestComponent>;
let component: DropdownTestComponent;

beforeEach(async(() => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
SkyDropdownFixturesModule
]
}).compileComponents();
}));

beforeEach(() => {
});
fixture = TestBed.createComponent(DropdownTestComponent);
component = fixture.componentInstance;
});

afterEach(() => {
fixture.destroy();
});

function openPopoverWithButtonClick() {
tick();
fixture.detectChanges();
Expand Down
4 changes: 3 additions & 1 deletion src/modules/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ export class SkyDropdownComponent implements OnInit, OnDestroy {
case SkyDropdownMessageType.Reposition:
// Only reposition the dropdown if it is already open.
if (this.isOpen) {
this.popover.reposition();
this.windowRef.getWindow().setTimeout(() => {
this.popover.reposition();
});
}
break;

Expand Down
5 changes: 2 additions & 3 deletions src/modules/popover/popover.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ describe('SkyPopoverComponent', () => {
}));

it('should expose a method to return the placement to the preferred placement', fakeAsync(() => {
spyOn(mockAdapterService, 'getPopoverPosition').and.returnValue({
const spy = spyOn(mockAdapterService, 'getPopoverPosition').and.returnValue({
top: 0,
left: 0,
arrowLeft: 0,
Expand All @@ -342,8 +342,7 @@ describe('SkyPopoverComponent', () => {
expect(component.placement).toEqual('right');

component.reposition();
expect(component.placement).toEqual('above');
tick();
expect(spy.calls.argsFor(1)[1]).toEqual('above');
}));

it('should hide the popover if its top or bottom boundaries leave its scrollable parent', fakeAsync(() => {
Expand Down
10 changes: 4 additions & 6 deletions src/modules/popover/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,11 @@ export class SkyPopoverComponent implements OnInit, OnDestroy {
this.placement = this.preferredPlacement;
this.changeDetector.markForCheck();

this.windowRef.getWindow().setTimeout(() => {
if (this.adapterService.isPopoverLargerThanParent(this.popoverContainer)) {
this.placement = 'fullscreen';
}
if (this.adapterService.isPopoverLargerThanParent(this.popoverContainer)) {
this.placement = 'fullscreen';
}

this.positionPopover();
});
this.positionPopover();
}

public close() {
Expand Down
5 changes: 3 additions & 2 deletions src/modules/timepicker/timepicker-component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ describe('Timepicker', () => {
const closeButton = fixture.nativeElement.querySelector('.sky-timepicker-footer button');
closeButton.click();
tick();
fixture.detectChanges();
tick();
const dropdown = fixture.nativeElement.querySelector('.sky-popover-container') as HTMLElement;
expect(dropdown.classList.contains('sky-popover-hidden')).toEqual(false);
const hiddenPopover = fixture.nativeElement.querySelector('.sky-popover-hidden') as HTMLElement;
expect(hiddenPopover).not.toBeNull();
}));

it('should handle input change with a string with the expected timeFormat', fakeAsync(() => {
Expand Down

0 comments on commit ff5093c

Please sign in to comment.