1
0
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:
Matthias Kretschmann 2019-03-04 13:50:24 -03:00
parent 05b3cfcc74
commit 49efed73c7
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -76,16 +76,18 @@ export default class Input extends PureComponent<InputProps, InputState> {
> >
<option value="">---</option> <option value="">---</option>
{options && {options &&
options.map((option: string, index: number) => ( options
<option .sort((a, b) => a.localeCompare(b))
key={index} .map((option: string, index: number) => (
value={slugify(option, { <option
lower: true key={index}
})} value={slugify(option, {
> lower: true
{option} })}
</option> >
))} {option}
</option>
))}
</select> </select>
</div> </div>
) )