Person page: make marriage-event spouse picker searchable
Adding a marriage/partnership event used a plain <select> for the spouse, which is unusable on a large tree — you can't search, only scroll. Swap it for the existing PersonCombobox (already used by the relationship form), which filters by name as you type. No onCreate, so it still resolves to an existing person id, which is what the partnership-event handler requires. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Justin Paul <justin@jpaul.me>
This commit is contained in:
@@ -1060,18 +1060,12 @@ export default function PersonDetailPage() {
|
||||
{isPartnershipType(evType) && (
|
||||
<label className="flex flex-col gap-1">
|
||||
<span className="text-xs text-[var(--muted)]">Spouse / partner</span>
|
||||
<select
|
||||
className={fieldCls}
|
||||
<PersonCombobox
|
||||
people={others}
|
||||
value={evSpouse}
|
||||
onChange={(e) => setEvSpouse(e.target.value)}
|
||||
>
|
||||
<option value="">— choose —</option>
|
||||
{others.map((p) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.primary_name ?? "Unnamed"}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
onChange={setEvSpouse}
|
||||
placeholder="Search for a spouse…"
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
<label className="flex flex-col gap-1">
|
||||
|
||||
Reference in New Issue
Block a user