1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

select empty value tweak

This commit is contained in:
Matthias Kretschmann 2020-09-10 13:28:03 +02:00
parent 0f6d5ffe62
commit c867253dd9
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -11,7 +11,7 @@ const DefaultInput = (props: InputProps) => (
)
export default function InputElement(props: InputProps): ReactElement {
const { type, options, name, prefix, postfix, small } = props
const { type, options, name, prefix, postfix, small, field } = props
switch (type) {
case 'select':
@ -21,7 +21,9 @@ export default function InputElement(props: InputProps): ReactElement {
className={`${styles.select} ${small && styles.selectSmall}`}
{...props}
>
<option value="">---</option>
{field !== undefined && field.value === '' && (
<option value="">---</option>
)}
{options &&
options
.sort((a: string, b: string) => a.localeCompare(b))