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:
@@ -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()
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user