From 59dd853f543baf277e8d8828ee95570601e11618 Mon Sep 17 00:00:00 2001 From: Szymon Stasik Date: Wed, 3 May 2017 05:27:13 -0500 Subject: [PATCH 1/2] fix(select): firing events properly in popover interface --- src/components/select/select-popover-component.ts | 5 +++++ src/components/select/select.ts | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/select/select-popover-component.ts b/src/components/select/select-popover-component.ts index b5cf4da92f..be8a1803f7 100644 --- a/src/components/select/select-popover-component.ts +++ b/src/components/select/select-popover-component.ts @@ -8,6 +8,7 @@ export interface SelectPopoverOption { value: string; disabled: boolean; checked: boolean; + handler?: Function; } /** @hidden */ @@ -30,6 +31,10 @@ export class SelectPopover implements OnInit { } public set value(value: any) { + let checkedOption = this.options.find(option => option.value === value); + if (checkedOption && checkedOption.handler) { + checkedOption.handler(); + } this.viewController.dismiss(value); } diff --git a/src/components/select/select.ts b/src/components/select/select.ts index 2ae817ca9e..a7648c0f7a 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -301,7 +301,11 @@ export class Select extends BaseInput implements OnDestroy { text: input.text, checked: input.selected, disabled: input.disabled, - value: input.value + value: input.value, + handler: () => { + this.value = input.value; + input.ionSelect.emit(input.value); + } })); overlay = new Popover(this._app, SelectPopover, { @@ -368,12 +372,6 @@ export class Select extends BaseInput implements OnDestroy { overlay.onDidDismiss((value: any) => { this._fireBlur(); - - if (this.interface === 'popover' && value) { - this.value = value; - this.ionChange.emit(value); - } - this._overlay = undefined; }); From 27a70fbdd85e77115d708672ceca15274e629840 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Wed, 3 May 2017 14:51:07 +0200 Subject: [PATCH 2/2] chore(e2e): add domCount() perf tool --- scripts/e2e/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/e2e/index.html b/scripts/e2e/index.html index fe5971a76d..65b155dcec 100644 --- a/scripts/e2e/index.html +++ b/scripts/e2e/index.html @@ -26,6 +26,17 @@ document.dir = 'ltr'; } + window.domCount = function domCount(ele) { + if(!ele) { + return 0; + } + var count = 1; + for(var i = 0; i < ele.children.length; i++) { + count += domCount(ele.children[i]); + } + return count; + } + if (location.href.indexOf('theme=dark') > -1) { var link = document.getElementById('ionicLink'); link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));