diff --git a/demos/local-storage/main.html b/demos/local-storage/main.html index 6f9d70b283..ea79bbd31e 100644 --- a/demos/local-storage/main.html +++ b/demos/local-storage/main.html @@ -45,7 +45,7 @@ Key - Select a Key + Select a Key {{ key }} diff --git a/demos/select/main.html b/demos/select/main.html index 8b0f62f7c9..5ba4d9376b 100644 --- a/demos/select/main.html +++ b/demos/select/main.html @@ -37,7 +37,7 @@ January February - March + March April May June @@ -54,7 +54,7 @@ 1991 1992 1993 - 1994 + 1994 1995 1996 1997 diff --git a/src/components/input/test/fixed-inline-labels/main.html b/src/components/input/test/fixed-inline-labels/main.html index be395af4ca..9d48f35d25 100644 --- a/src/components/input/test/fixed-inline-labels/main.html +++ b/src/components/input/test/fixed-inline-labels/main.html @@ -23,7 +23,7 @@ CC - Admin + Admin diff --git a/src/components/input/test/stacked-labels/main.html b/src/components/input/test/stacked-labels/main.html index 8535387bef..2ac801912c 100644 --- a/src/components/input/test/stacked-labels/main.html +++ b/src/components/input/test/stacked-labels/main.html @@ -47,7 +47,7 @@ Label 6 - Female + Female Male diff --git a/src/components/option/option.ts b/src/components/option/option.ts index 8cc85b3429..10bd6c1874 100644 --- a/src/components/option/option.ts +++ b/src/components/option/option.ts @@ -5,7 +5,7 @@ import { isPresent, isTrueProperty } from '../../util/util'; /** * @name Option * @description - * `ion-option` is a child component of `ion-select`. Similar to the native option element, `ion-option` can take a value and a checked property. + * `ion-option` is a child component of `ion-select`. Similar to the native option element, `ion-option` can take a value and a selected property. * * @demo /docs/v2/demos/item-sliding/ */ @@ -13,7 +13,7 @@ import { isPresent, isTrueProperty } from '../../util/util'; selector: 'ion-option' }) export class Option { - private _checked: any = false; + private _selected: any = false; private _disabled: any = false; private _value: any; @@ -25,15 +25,15 @@ export class Option { constructor(private _elementRef: ElementRef) {} /** - * @input {boolean} Whether or not the option is already checked and selected + * @input {boolean} Whether or not the option is already selected */ @Input() - get checked() { - return this._checked; + get selected() { + return this._selected; } - set checked(val) { - this._checked = isTrueProperty(val); + set selected(val) { + this._selected = isTrueProperty(val); } /** diff --git a/src/components/select/select.ts b/src/components/select/select.ts index 4b584484b0..171d578c85 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -48,7 +48,7 @@ export const SELECT_VALUE_ACCESSOR = new Provider( * * Gender * - * Female + * Female * Male * * @@ -175,11 +175,6 @@ export class Select implements AfterContentInit, ControlValueAccessor, OnDestroy */ @Input() alertOptions: any = {}; - /** - * @private - */ - @Input() checked: any = false; - /** * @input {string} The interface the select should use: `action-sheet` or `alert`. Default: `alert`. */ @@ -273,7 +268,7 @@ export class Select implements AfterContentInit, ControlValueAccessor, OnDestroy if (this.interface === 'action-sheet') { alertOptions.buttons = alertOptions.buttons.concat(options.map(input => { return { - role: (input.checked ? 'selected' : ''), + role: (input.selected ? 'selected' : ''), text: input.text, handler: () => { this.onChange(input.value); @@ -296,7 +291,7 @@ export class Select implements AfterContentInit, ControlValueAccessor, OnDestroy type: (this._multi ? 'checkbox' : 'radio'), label: input.text, value: input.value, - checked: input.checked, + checked: input.selected, disabled: input.disabled }; }); @@ -366,8 +361,8 @@ export class Select implements AfterContentInit, ControlValueAccessor, OnDestroy if (!this._values.length) { // there are no values set at this point - // so check to see who should be checked - this._values = val.filter(o => o.checked).map(o => o.value); + // so check to see who should be selected + this._values = val.filter(o => o.selected).map(o => o.value); } this._updOpts(); @@ -382,11 +377,11 @@ export class Select implements AfterContentInit, ControlValueAccessor, OnDestroy if (this._options) { this._options.forEach(option => { // check this option if the option's value is in the values array - option.checked = this._values.some(selectValue => { + option.selected = this._values.some(selectValue => { return isCheckedProperty(selectValue, option.value); }); - if (option.checked) { + if (option.selected) { this._texts.push(option.text); } }); diff --git a/src/components/select/test/multiple-value/index.ts b/src/components/select/test/multiple-value/index.ts index 926cce5de8..bf8f707dce 100644 --- a/src/components/select/test/multiple-value/index.ts +++ b/src/components/select/test/multiple-value/index.ts @@ -25,7 +25,7 @@ class E2EPage { { text: 'Honey Badger', value: 'honeybadger' }, { text: 'Pig', value: 'pig' }, ]; - this.status = 'checked'; + this.status = 'selected'; this.authForm = new FormGroup({ name: new FormControl(''), diff --git a/src/components/select/test/multiple-value/main.html b/src/components/select/test/multiple-value/main.html index fb5784c098..c0d1b88818 100644 --- a/src/components/select/test/multiple-value/main.html +++ b/src/components/select/test/multiple-value/main.html @@ -47,14 +47,14 @@ Disabled - Selected Text + Selected Text Statuses - Checked + Selected Default Disabled diff --git a/src/components/select/test/single-value/index.ts b/src/components/select/test/single-value/index.ts index 3701419a37..8f4f83e79b 100644 --- a/src/components/select/test/single-value/index.ts +++ b/src/components/select/test/single-value/index.ts @@ -14,7 +14,7 @@ class E2EPage { month: string; year: string; years: Array; - notification: string; + notifications: string; status: string; constructor() { @@ -23,8 +23,8 @@ class E2EPage { this.music = null; this.month = '12'; this.year = '1994'; - this.notification = 'enable'; - this.status = 'checked'; + this.notifications = 'enable'; + this.gender = 'f'; this.years = [1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]; @@ -47,6 +47,10 @@ class E2EPage { console.log('STP selected'); } + statusChange(ev: string) { + this.status = ev; + } + resetGender() { this.gender = null; } diff --git a/src/components/select/test/single-value/main.html b/src/components/select/test/single-value/main.html index 4360f4b77a..a773272c30 100644 --- a/src/components/select/test/single-value/main.html +++ b/src/components/select/test/single-value/main.html @@ -12,7 +12,7 @@ Gender - Female + Female Male @@ -44,7 +44,7 @@ Notifications - + Enable Mute Mute for a week @@ -88,8 +88,8 @@ Statuses - - Checked + + Selected Default Disabled @@ -104,10 +104,14 @@
os: {{os}}
+ notifications: {{notifications}} +
music: {{music}}
date: {{month}}/{{year}}
+ status: {{status}} +