From 40e7eb23502fd60d3eb9514e90d00c264fb42652 Mon Sep 17 00:00:00 2001
From: Brandy Carney
Date: Thu, 12 Jan 2017 17:03:00 -0500
Subject: [PATCH] fix(select): set disabled state from FormControl
---
src/components/select/select.ts | 7 +++++++
.../select/test/single-value/app-module.ts | 6 ++++++
src/components/select/test/single-value/main.html | 12 ++++++++++++
3 files changed, 25 insertions(+)
diff --git a/src/components/select/select.ts b/src/components/select/select.ts
index 7a31dd09f4..e7e80c6317 100644
--- a/src/components/select/select.ts
+++ b/src/components/select/select.ts
@@ -487,6 +487,13 @@ export class Select extends Ion implements AfterContentInit, ControlValueAccesso
*/
onTouched() { }
+ /**
+ * @private
+ */
+ setDisabledState(isDisabled: boolean) {
+ this.disabled = isDisabled;
+ }
+
/**
* @private
*/
diff --git a/src/components/select/test/single-value/app-module.ts b/src/components/select/test/single-value/app-module.ts
index 6acd44d8a2..6855007443 100644
--- a/src/components/select/test/single-value/app-module.ts
+++ b/src/components/select/test/single-value/app-module.ts
@@ -1,4 +1,5 @@
import { Component, NgModule } from '@angular/core';
+import { FormControl, FormGroup } from '@angular/forms';
import { IonicApp, IonicModule } from '../../../..';
export interface Currency {
@@ -55,6 +56,11 @@ export class E2EPage {
];
currency: Currency;
+ fruitCtrl = new FormControl({value: 'grape', disabled: true});
+ fruitsForm = new FormGroup({
+ 'fruit': this.fruitCtrl
+ });
+
constructor() {
this.currency = this.currencies[0];
}
diff --git a/src/components/select/test/single-value/main.html b/src/components/select/test/single-value/main.html
index 54ff20ddfc..dcafc93d36 100644
--- a/src/components/select/test/single-value/main.html
+++ b/src/components/select/test/single-value/main.html
@@ -125,4 +125,16 @@
+
+