From a8d6142566f5dbfcc409e398012166582f85f396 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Mon, 15 Jun 2026 08:19:42 -0400 Subject: [PATCH] fix(18): timezone picker shows full list on tap (native select) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IANA picker was an , which filters the dropdown by whatever text is already in the field — so with the stored zone pre-filled a user only saw a single option and had to erase the value (undiscoverable) to browse. datalist is also unreliable in iOS Safari. Replace it with a native grouped by region, which has the + * ARIA combobox role. Selecting a zone uses selectOption (not fill), and the + * option's value is the full IANA id even though its visible label is shortened. */ import { test, expect } from '@playwright/test'; @@ -22,12 +23,12 @@ test.describe('Admin Timezone section — 18-04 round-trip', () => { await expect(page.getByRole('region', { name: 'Timezone' })).toBeVisible(); }); - test('Timezone input (combobox) is visible and pre-filled', async ({ page }) => { - // ARIA role for is combobox + test('Timezone picker (combobox) is visible and pre-filled', async ({ page }) => { + // Native . A native select shows the full list on tap with no typing — + // and renders as the native wheel picker on iOS — unlike a datalist, which hides + // the list behind whatever text is already in the field. + const zonesByRegion = ianaZones.reduce>((acc, tz) => { + const region = tz.includes('/') ? tz.slice(0, tz.indexOf('/')) : 'Other'; + (acc[region] ??= []).push(tz); + return acc; + }, {}); + const regionOrder = Object.keys(zonesByRegion).sort((a, b) => + a === 'Other' ? 1 : b === 'Other' ? -1 : a.localeCompare(b), + ); + // Defensive: a stored/validated zone could (rarely) be absent from supportedValuesOf. + const currentZoneMissing = + !!effectiveTimezoneInput && !ianaZones.includes(effectiveTimezoneInput); + // Save shared calendar mutation const sharedCalMutation = useMutation({ mutationFn: (calId: number) => setSharedCalendar(calId), @@ -382,14 +398,13 @@ export function AdminPage() { )} - {/* Searchable IANA picker */} + {/* IANA picker — native setTimezoneInput(e.target.value)} - placeholder="e.g. America/Chicago" aria-label="Household timezone" style={{ width: '100%', @@ -402,13 +417,22 @@ export function AdminPage() { color: 'var(--color-text-primary)', background: 'var(--color-surface, #ffffff)', minHeight: '44px', + cursor: 'pointer', }} - /> - - {ianaZones.map((tz) => ( - + )} + {regionOrder.map((region) => ( + + {zonesByRegion[region].map((tz) => ( + + ))} + ))} - + {/* Use detected zone affordance (D-02) */}