mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
fix(alert): remove unneeded warning
This commit is contained in:
@ -143,7 +143,7 @@ export class Alert implements OverlayInterface {
|
|||||||
// An alert can be created with several different inputs. Radios,
|
// An alert can be created with several different inputs. Radios,
|
||||||
// checkboxes and inputs are all accepted, but they cannot be mixed.
|
// checkboxes and inputs are all accepted, but they cannot be mixed.
|
||||||
const inputTypes = new Set(inputs.map(i => i.type));
|
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.`);
|
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;
|
this.inputType = inputTypes.values().next().value;
|
||||||
|
@ -367,18 +367,19 @@ export class Select {
|
|||||||
const labelText = (label) ? label.textContent : null;
|
const labelText = (label) ? label.textContent : null;
|
||||||
|
|
||||||
const interfaceOptions = this.interfaceOptions;
|
const interfaceOptions = this.interfaceOptions;
|
||||||
|
const inputType = (this.multiple ? 'checkbox' : 'radio');
|
||||||
const alertOpts: AlertOptions = {
|
const alertOpts: AlertOptions = {
|
||||||
...interfaceOptions,
|
...interfaceOptions,
|
||||||
|
|
||||||
header: interfaceOptions.header ? interfaceOptions.header : labelText,
|
header: interfaceOptions.header ? interfaceOptions.header : labelText,
|
||||||
inputs: this.childOpts.map(o => {
|
inputs: this.childOpts.map(o => {
|
||||||
return {
|
return {
|
||||||
type: (this.multiple ? 'checkbox' : 'radio'),
|
type: inputType,
|
||||||
label: o.textContent,
|
label: o.textContent,
|
||||||
value: o.value,
|
value: o.value,
|
||||||
checked: o.selected,
|
checked: o.selected,
|
||||||
disabled: o.disabled
|
disabled: o.disabled
|
||||||
} as AlertInput;
|
};
|
||||||
}),
|
}),
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user