diff options
author | Sascha <GlancingMind@outlook.com> | 2021-03-30 10:22:10 +0200 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-04-08 14:57:39 +0200 |
commit | 41418c912d5521708e5f3fbdea2415a5e95c72c0 (patch) | |
tree | 54d3ddc6e1225f39f2e7b25ad5d73f3d278838d7 /webui | |
parent | d39e6c4c4391c1a3cd96f791b47d66b043da7f51 (diff) | |
download | git-bug-41418c912d5521708e5f3fbdea2415a5e95c72c0.tar.gz |
Let CreateNewLabel-Btn appear as first element in list
Diffstat (limited to 'webui')
-rw-r--r-- | webui/src/pages/bug/labels/LabelMenu.tsx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/webui/src/pages/bug/labels/LabelMenu.tsx b/webui/src/pages/bug/labels/LabelMenu.tsx index 8213d15b..2422e865 100644 --- a/webui/src/pages/bug/labels/LabelMenu.tsx +++ b/webui/src/pages/bug/labels/LabelMenu.tsx @@ -168,6 +168,20 @@ function FilterDropdown({ label={`Filter ${children}`} /> )} + {filter !== '' && + dropdown.filter((d) => d[1].toLowerCase() === filter.toLowerCase()) + .length <= 0 && ( + <MenuItem + style={{ whiteSpace: 'normal', wordBreak: 'break-all' }} + onClick={() => { + onNewItem(filter); + setFilter(''); + setOpen(false); + }} + > + Create new label '{filter}' + </MenuItem> + )} {dropdown .sort(function (x, y) { // true values first @@ -193,20 +207,6 @@ function FilterDropdown({ </div> </MenuItem> ))} - {filter !== '' && - dropdown.filter((d) => d[1].toLowerCase() === filter.toLowerCase()) - .length <= 0 && ( - <MenuItem - style={{ whiteSpace: 'normal', wordBreak: 'break-all' }} - onClick={() => { - onNewItem(filter); - setFilter(''); - setOpen(false); - }} - > - Create new label '{filter}' - </MenuItem> - )} </Menu> </> ); |