Fire onChangeDate alongside onConfirm on iOS Done

On iOS, onDateChange only fires on scroll, so an empty field confirmed
without scrolling reported a date via onConfirm while onChangeDate stayed
silent. Call onChangeDate(draft) in the Done handler for parity with Android
and web, where committing fires both together.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
DS Boyce
2026-06-25 17:53:50 -05:00
committed by Eric Bailey
parent 1f2cf3ba02
commit 1f8d82ecb5
+8
View File
@@ -121,6 +121,14 @@ export function DateField({
<Button
label={_(msg`Done`)}
onPress={() => {
/*
* Commit the currently shown date even if the user never
* scrolled (onDateChange only fires on scroll). This keeps
* onChangeDate firing alongside onConfirm, matching Android and
* web, so an empty field confirmed without scrolling does not
* report a date via onConfirm while onChangeDate stays silent.
*/
onChangeDate(draft)
onConfirm?.(draft)
control.close()
}}