From 29bd0582059c1517c64fa93e30b0ea78cb7b6b74 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 27 Nov 2018 16:19:27 +0100 Subject: [PATCH] fix(alert): accepts any value fixes #16170 --- core/src/components/alert/alert-interface.ts | 2 +- core/src/components/alert/alert.tsx | 2 +- core/src/components/radio/radio.tsx | 2 +- .../select/test/conflict/index.html | 83 +++++++++++++++++++ 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 core/src/components/select/test/conflict/index.html diff --git a/core/src/components/alert/alert-interface.ts b/core/src/components/alert/alert-interface.ts index a295b336312..4b109ea99f1 100644 --- a/core/src/components/alert/alert-interface.ts +++ b/core/src/components/alert/alert-interface.ts @@ -23,7 +23,7 @@ export interface AlertInput { type?: TextFieldTypes | 'checkbox' | 'radio'; name?: string; placeholder?: string; - value?: string; + value?: any; label?: string; checked?: boolean; disabled?: boolean; diff --git a/core/src/components/alert/alert.tsx b/core/src/components/alert/alert.tsx index e8b0e3e1166..963425e3b22 100644 --- a/core/src/components/alert/alert.tsx +++ b/core/src/components/alert/alert.tsx @@ -156,7 +156,7 @@ export class Alert implements ComponentInterface, OverlayInterface { type: i.type || 'text', name: i.name || `${index}`, placeholder: i.placeholder || '', - value: i.value || '', + value: i.value, label: i.label, checked: !!i.checked, disabled: !!i.disabled, diff --git a/core/src/components/radio/radio.tsx b/core/src/components/radio/radio.tsx index 80ba25330f6..d8b4e0af8c7 100644 --- a/core/src/components/radio/radio.tsx +++ b/core/src/components/radio/radio.tsx @@ -105,7 +105,7 @@ export class Radio implements ComponentInterface { } componentWillLoad() { - if (this.value == null) { + if (this.value === undefined) { this.value = this.inputId; } this.emitStyle(); diff --git a/core/src/components/select/test/conflict/index.html b/core/src/components/select/test/conflict/index.html new file mode 100644 index 00000000000..e6aba2464fa --- /dev/null +++ b/core/src/components/select/test/conflict/index.html @@ -0,0 +1,83 @@ + + + + + + Select - Basic + + + + + + + + + + + + Select - Conflict + + + + + + + + Alert + + Unselected + Zero + Empty String + Null + + + + + Action-sheet + + Unselected + Zero + Empty String + Null + + + + + Popover + + Unselected + Zero + Empty String + Null + + + + + + + + + + + + + +