mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
sort all select options alphabetically
This commit is contained in:
parent
05b3cfcc74
commit
49efed73c7
@ -76,16 +76,18 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
||||
>
|
||||
<option value="">---</option>
|
||||
{options &&
|
||||
options.map((option: string, index: number) => (
|
||||
<option
|
||||
key={index}
|
||||
value={slugify(option, {
|
||||
lower: true
|
||||
})}
|
||||
>
|
||||
{option}
|
||||
</option>
|
||||
))}
|
||||
options
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map((option: string, index: number) => (
|
||||
<option
|
||||
key={index}
|
||||
value={slugify(option, {
|
||||
lower: true
|
||||
})}
|
||||
>
|
||||
{option}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user