From 0a04522d38240d90e83b12cba8cf08ce7c25d810 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 27 Jan 2016 22:22:34 -0600 Subject: [PATCH] fix(select): update text on ngModel change --- ionic/components/select/select.scss | 2 +- ionic/components/select/select.ts | 170 +++++++++--------- .../select/test/multiple-value/index.ts | 10 ++ .../select/test/multiple-value/main.html | 14 +- .../select/test/single-value/index.ts | 4 + 5 files changed, 108 insertions(+), 92 deletions(-) diff --git a/ionic/components/select/select.scss b/ionic/components/select/select.scss index a334c8381e..62034fa479 100644 --- a/ionic/components/select/select.scss +++ b/ionic/components/select/select.scss @@ -6,12 +6,12 @@ ion-select { display: flex; overflow: hidden; + max-width: 45%; } .select-text { flex: 1; min-width: 16px; - max-width: 120px; font-size: inherit; white-space: nowrap; overflow: hidden; diff --git a/ionic/components/select/select.ts b/ionic/components/select/select.ts index b2dde622c6..c91df9f72c 100644 --- a/ionic/components/select/select.ts +++ b/ionic/components/select/select.ts @@ -4,7 +4,7 @@ import {NgControl} from 'angular2/common'; import {Alert} from '../alert/alert'; import {Form} from '../../util/form'; import {Item} from '../item/item'; -import {merge, isDefined, isTrueProperty} from '../../util/util'; +import {merge, isTrueProperty, isBlank} from '../../util/util'; import {NavController} from '../nav/nav-controller'; import {Option} from '../option/option'; @@ -97,7 +97,7 @@ import {Option} from '../option/option'; @Component({ selector: 'ion-select', template: - '
{{text}}
' + + '
{{_text}}
' + '
' + '
' + '
' + @@ -112,22 +112,25 @@ import {Option} from '../option/option'; export class Select { private _disabled: any = false; private _labelId: string; + private _multi: boolean = false; + private _options: QueryList