From dc6c5863fb9c88e5c1599d02a8e9a7993a4c7bf8 Mon Sep 17 00:00:00 2001 From: Zachary Keeton Date: Thu, 8 Jun 2017 08:35:23 -0400 Subject: [PATCH] fix(select): return undefined when there are no options (#11968) * fix(select): make select with no options return undefined when OK is pressed (#10435) * refactor(select): add early check for alert inputs fixes #10435 --- src/components/alert/alert-component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 7fde84ad97..836f34f725 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -316,6 +316,11 @@ export class AlertCmp { return this.d.inputs.filter(i => i.checked).map(i => i.value); } + if (this.d.inputs.length === 0) { + // this is an alert without any options/inputs at all + return undefined; + } + // this is an alert with text inputs // return an object of all the values with the input name as the key const values: {[k: string]: string} = {};