diff --git a/app/routes/app.blackouts._index.tsx b/app/routes/app.blackouts._index.tsx index acb98ae..0fc495d 100644 --- a/app/routes/app.blackouts._index.tsx +++ b/app/routes/app.blackouts._index.tsx @@ -77,6 +77,9 @@ export default function BlackoutsIndex() { const isSubmitting = navigation.state === "submitting"; const [date, setDate] = useState(""); const [reason, setReason] = useState(""); + // Polaris Select needs value+onChange to register a choice (see slots route). + const [locationId, setLocationId] = useState(""); + const [method, setMethod] = useState(""); if (locations.length === 0) { return ( @@ -150,11 +153,15 @@ export default function BlackoutsIndex() { ({ label: m.replace("_", " "), value: m })), diff --git a/app/routes/app.rates._index.tsx b/app/routes/app.rates._index.tsx index 5df3ddd..8366fc3 100644 --- a/app/routes/app.rates._index.tsx +++ b/app/routes/app.rates._index.tsx @@ -195,6 +195,8 @@ function AddRateForm({ isSubmitting: boolean; }) { const [keyedBy, setKeyedBy] = useState("zone"); + const [method, setMethod] = useState(METHODS[0]); + const [zoneId, setZoneId] = useState(zones[0]?.id ?? ""); const [name, setName] = useState(""); const [price, setPrice] = useState(""); const [minDistanceKm, setMinDistanceKm] = useState(""); @@ -209,12 +211,20 @@ function AddRateForm({ - setMethod(v as Method)} + options={METHODS.map((m) => ({ label: m.replace("_", " "), value: m }))} + /> ({ label: `${z.name} (${z.location.name})`, value: z.id }))} /> ) : ( diff --git a/app/routes/app.slots._index.tsx b/app/routes/app.slots._index.tsx index e8f5ccd..9527867 100644 --- a/app/routes/app.slots._index.tsx +++ b/app/routes/app.slots._index.tsx @@ -209,6 +209,11 @@ export default function SlotsIndex() { } function AddSlotForm({ locationId, isSubmitting }: { locationId: string; isSubmitting: boolean }) { + // Polaris Select is a controlled component — without value/onChange it + // renders but won't register a selection (same class of bug as commit + // cc20f20 for TextField). Keep weekday/method in local state. + const [weekday, setWeekday] = useState("1"); + const [method, setMethod] = useState("SHIPPING"); const [startTime, setStartTime] = useState("09:00"); const [endTime, setEndTime] = useState("17:00"); const [capacity, setCapacity] = useState("10"); @@ -229,11 +234,15 @@ function AddSlotForm({ locationId, isSubmitting }: { locationId: string; isSubmi setMethod(value as Method)} options={METHODS.map((m) => ({ label: m.replace("_", " "), value: m }))} />