Skip to content

fix(ui): Convert TimePicker to controlled component to fix Safari reload#115711

Open
sjpriest wants to merge 1 commit into
getsentry:masterfrom
sjpriest:fix/safari-timepicker-reload
Open

fix(ui): Convert TimePicker to controlled component to fix Safari reload#115711
sjpriest wants to merge 1 commit into
getsentry:masterfrom
sjpriest:fix/safari-timepicker-reload

Conversation

@sjpriest
Copy link
Copy Markdown

@sjpriest sjpriest commented May 18, 2026

Safari fires blur before change on <input type="time">, while Chrome fires change first. The old class-based TimePicker used a shouldComponentUpdate guard that blocked re-renders while focused, combined with key={value} which unmounts/remounts the input on value changes. In Safari, the blur-first ordering caused the input to be destroyed and recreated mid-interaction, triggering unexpected page reloads.

Controlled component rewrite

Converts TimePicker from a class component using shouldComponentUpdate + key + defaultValue (uncontrolled) to a functional component using useState + useEffect + value (controlled). Local state tracks input values and syncs from parent props, eliminating the event-ordering race entirely.

Manually verified the fix in Safari (where the bug reproduced) and Chrome (no regression).

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 18, 2026
@sjpriest sjpriest marked this pull request as ready for review May 18, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant