Skip to content

Commit

Permalink
chore(frontend): allow unchecking last item in dropdown select if "No…
Browse files Browse the repository at this point in the history
…ne" is available

closes #1758
  • Loading branch information
anupcowkur committed Jan 22, 2025
1 parent 5c1cc1e commit 399251a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions frontend/dashboard/app/components/dropdown_select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ const DropdownSelect: React.FC<DropdownSelectProps> = ({ title, type, items, ini
const toggleCheckboxStringItem = (item: string) => {
let curSelected = selected as string[]
if (curSelected.includes(item)) {
// If only one item is selected, do nothing
if (curSelected.length === 1) {
return
}
setSelected(curSelected.filter(a => a != item))
} else {
setSelected([item, ...curSelected])
Expand All @@ -110,10 +106,6 @@ const DropdownSelect: React.FC<DropdownSelectProps> = ({ title, type, items, ini
const toggleCheckboxOsVersionItem = (item: OsVersion) => {
let curSelected = selected as OsVersion[]
if (isOsVersionSelected(item)) {
// If only one item is selected, do nothing
if (curSelected.length === 1) {
return
}
setSelected(curSelected.filter(a => a != item))
} else {
setSelected([item, ...curSelected])
Expand Down

0 comments on commit 399251a

Please sign in to comment.