Skip to content

Commit 44607b1

Browse files
Jezclaude
andcommitted
fix: Radix UI Select empty value crash in deal form
Issue: Deal form crashed when opening contact dropdown Root Cause: Radix UI Select doesn't support empty string values Solution: Use sentinel value "__none__" instead of empty string Changes: - src/modules/deals/components/deal-form.tsx * Line 133: Updated onValueChange to handle "__none__" sentinel * Line 136: Set default value to "__none__" when contactId is undefined * Line 144: Changed SelectItem value from "" to "__none__" - SESSION.md * Added "Post-Launch Bug Fixes" section * Documented bug fix details Tested: Deal form now opens without errors, "None" option works correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent df75e37 commit 44607b1

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

SESSION.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Session State
22

3-
**Current Phase**: Phase 6
4-
**Current Stage**: Planning
5-
**Last Checkpoint**: 3950032 (2025-11-08)
3+
**Current Phase**: All phases complete! 🎉
4+
**Current Stage**: Production Ready
5+
**Last Checkpoint**: df75e37 (2025-11-08)
66
**Planning Docs**: `docs/IMPLEMENTATION_PHASES.md`, `docs/DATABASE_SCHEMA.md`
77

88
---
@@ -68,7 +68,7 @@
6868
- `src/components/navigation.tsx` (changed title from "TodoApp" to "CRM")
6969

7070
## Phase 6: Testing & Documentation ✅
71-
**Completed**: 2025-11-08 | **Checkpoint**: (pending)
71+
**Completed**: 2025-11-08 | **Checkpoint**: df75e37
7272
**Summary**: Created comprehensive testing and documentation suite. Added seed script with realistic data (10 contacts, 5 tags, 5 deals), complete testing checklist (TESTING.md), verified DATABASE_SCHEMA.md accuracy, and updated README.md with CRM features section.
7373

7474
**Key Deliverables**:
@@ -92,3 +92,14 @@
9292
- Database schema with ERD and query patterns
9393
- Testing checklist with manual test procedures
9494
- README with CRM features overview and module structure
95+
96+
---
97+
98+
## Post-Launch Bug Fixes
99+
100+
### Bug Fix: Radix UI Select Empty Value (2025-11-08)
101+
**Issue**: Deal form crashed when opening contact dropdown due to empty string value in SelectItem
102+
**Root Cause**: Radix UI Select doesn't support empty string values
103+
**Fix**: Replaced `value=""` with sentinel value `"__none__"` and updated onChange logic
104+
**File**: `src/modules/deals/components/deal-form.tsx` (lines 133, 136, 144)
105+
**Status**: ✅ Fixed and tested

src/modules/deals/components/deal-form.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,18 @@ export function DealForm({ initialData, contacts }: DealFormProps) {
130130
<Select
131131
onValueChange={(value) =>
132132
field.onChange(
133-
value ? Number.parseInt(value) : undefined,
133+
value === "__none__" ? undefined : Number.parseInt(value),
134134
)
135135
}
136-
value={field.value?.toString()}
136+
value={field.value?.toString() || "__none__"}
137137
>
138138
<FormControl>
139139
<SelectTrigger>
140140
<SelectValue placeholder="Select a contact" />
141141
</SelectTrigger>
142142
</FormControl>
143143
<SelectContent>
144-
<SelectItem value="">None</SelectItem>
144+
<SelectItem value="__none__">None</SelectItem>
145145
{contacts.map((contact) => (
146146
<SelectItem
147147
key={contact.id}

0 commit comments

Comments
 (0)