summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/components
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-11-24 09:52:58 -0300
committerSebastian <sebasjm@gmail.com>2021-11-24 09:53:05 -0300
commit668c0430c204c1233fc266b723ed1be308d5f3f1 (patch)
treedbed1b91eebfc2ca6761f94d2d52be97067dce45 /packages/taler-wallet-webextension/src/components
parent0bfd4523b3408d9c841a1f25fd9ec86e81d6dd8f (diff)
downloadwallet-core-668c0430c204c1233fc266b723ed1be308d5f3f1.tar.gz
wallet-core-668c0430c204c1233fc266b723ed1be308d5f3f1.tar.bz2
wallet-core-668c0430c204c1233fc266b723ed1be308d5f3f1.zip
fix exchange selection
Diffstat (limited to 'packages/taler-wallet-webextension/src/components')
-rw-r--r--packages/taler-wallet-webextension/src/components/SelectList.tsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/components/SelectList.tsx b/packages/taler-wallet-webextension/src/components/SelectList.tsx
index 78dd2feb4..5bb06f9a8 100644
--- a/packages/taler-wallet-webextension/src/components/SelectList.tsx
+++ b/packages/taler-wallet-webextension/src/components/SelectList.tsx
@@ -36,6 +36,7 @@ export function SelectList({
onChange,
label,
description,
+ canBeNull,
}: Props): VNode {
return (
<Fragment>
@@ -49,20 +50,21 @@ export function SelectList({
<NiceSelect>
<select
name={name}
+ value={value}
onChange={(e) => {
- console.log(e.currentTarget.value, value);
onChange(e.currentTarget.value);
}}
>
- {value !== undefined ? (
- <option selected>{list[value]}</option>
- ) : (
- <option selected disabled>
- Select one option
- </option>
- )}
+ {value === undefined ||
+ (canBeNull && (
+ <option selected disabled>
+ Select one option
+ </option>
+ // ) : (
+ // <option selected>{list[value]}</option>
+ ))}
{Object.keys(list)
- .filter((l) => l !== value)
+ // .filter((l) => l !== value)
.map((key) => (
<option value={key} key={key}>
{list[key]}