Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(frontend): allow unchecking last item in dropdown select if "None" is available #1760

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading