From 8447f286ccfba96dabbef612b77191b7423b1251 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Mon, 27 Aug 2018 19:25:24 +0200 Subject: [PATCH] fix(alert): remove unneeded warning --- core/src/components/alert/alert.tsx | 2 +- core/src/components/select/select.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/components/alert/alert.tsx b/core/src/components/alert/alert.tsx index 6ea84769b9..a9a43e9c8c 100644 --- a/core/src/components/alert/alert.tsx +++ b/core/src/components/alert/alert.tsx @@ -143,7 +143,7 @@ export class Alert implements OverlayInterface { // An alert can be created with several different inputs. Radios, // checkboxes and inputs are all accepted, but they cannot be mixed. const inputTypes = new Set(inputs.map(i => i.type)); - if (inputTypes.has('checkbox') || inputTypes.has('radio')) { + if (inputTypes.has('checkbox') && inputTypes.has('radio')) { console.warn(`Alert cannot mix input types: ${(Array.from(inputTypes.values()).join('/'))}. Please see alert docs for more info.`); } this.inputType = inputTypes.values().next().value; diff --git a/core/src/components/select/select.tsx b/core/src/components/select/select.tsx index c57ac0399d..50cfd062f0 100644 --- a/core/src/components/select/select.tsx +++ b/core/src/components/select/select.tsx @@ -367,18 +367,19 @@ export class Select { const labelText = (label) ? label.textContent : null; const interfaceOptions = this.interfaceOptions; + const inputType = (this.multiple ? 'checkbox' : 'radio'); const alertOpts: AlertOptions = { ...interfaceOptions, header: interfaceOptions.header ? interfaceOptions.header : labelText, inputs: this.childOpts.map(o => { return { - type: (this.multiple ? 'checkbox' : 'radio'), + type: inputType, label: o.textContent, value: o.value, checked: o.selected, disabled: o.disabled - } as AlertInput; + }; }), buttons: [ {