Add current job to defaultValue and properly sort groups
This commit is contained in:
parent
c401804e7b
commit
653dd3d493
1 changed files with 4 additions and 2 deletions
|
|
@ -102,7 +102,7 @@ const JobDropdown = React.forwardRef<HTMLSelectElement, Props>(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
trigger={'Select a class...'}
|
defaultValue={props.currentJob}
|
||||||
placeholder={'Select a class...'}
|
placeholder={'Select a class...'}
|
||||||
open={open}
|
open={open}
|
||||||
onClick={openJobSelect}
|
onClick={openJobSelect}
|
||||||
|
|
@ -113,7 +113,9 @@ const JobDropdown = React.forwardRef<HTMLSelectElement, Props>(
|
||||||
No class
|
No class
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
{sortedJobs
|
{sortedJobs
|
||||||
? Object.keys(sortedJobs).map((x) => renderJobGroup(x))
|
? Object.keys(sortedJobs)
|
||||||
|
.sort((a, b) => ('' + a).localeCompare(b))
|
||||||
|
.map((x) => renderJobGroup(x))
|
||||||
: ''}
|
: ''}
|
||||||
</Select>
|
</Select>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue