Skip to content

Commit

Permalink
fix(alert): remove unneeded warning
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Aug 27, 2018
1 parent ecf1eb8 commit 8447f28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions core/src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down

0 comments on commit 8447f28

Please sign in to comment.