Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix(dashboard): handle null dropdown values in integration credential…
… select

Radix Select crashes when a <Select.Item /> receives an empty string value.
This happened for providers like SparkPost and iSendSMS that have dropdown
credentials with null values (e.g., 'Default' region option).

Use a sentinel value for null/empty dropdown options and convert back on
selection to prevent the crash while preserving the original behavior.

Co-authored-by: Dima Grossman <dima@grossman.io>
  • Loading branch information
cursoragent and scopsy committed Feb 16, 2026
commit 4470588657dbbced6030e684999a271e687014f6
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ function SwitchInput({
);
}

const NULL_DROPDOWN_VALUE = '__null__';

function toSelectValue(value: string | null | undefined): string {
if (value === null || value === undefined || value === '') return NULL_DROPDOWN_VALUE;

return value;
}

function fromSelectValue(value: string): string {
if (value === NULL_DROPDOWN_VALUE) return '';

return value;
}

function DropdownInput({
credential,
field,
Expand All @@ -100,13 +114,17 @@ function DropdownInput({
<>
<FormLabel credential={credential} tooltip={tooltip} />
<FormControl>
<Select value={stringValue} onValueChange={field.onChange} disabled={isReadOnly}>
<Select
value={toSelectValue(stringValue)}
onValueChange={(val) => field.onChange(fromSelectValue(val))}
disabled={isReadOnly}
>
<SelectTrigger>
<SelectValue placeholder={credential.placeholder ?? `Select ${credential.displayName.toLowerCase()}`} />
</SelectTrigger>
<SelectContent>
{credential.dropdown?.map((option) => (
<SelectItem key={option.value || ''} value={option.value || ''}>
<SelectItem key={toSelectValue(option.value)} value={toSelectValue(option.value)}>
{option.name}
</SelectItem>
))}
Expand Down
Loading