From 2d4b53633e130011690650e1c43f826ddf660d7b Mon Sep 17 00:00:00 2001 From: Vikrant Date: Sun, 8 Nov 2026 11:30:17 +0530 Subject: [PATCH] fix: prevent DateField ariaLabel destructuring error --- design-system/pkg/src/date-time/DateField.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/design-system/pkg/src/date-time/DateField.tsx b/design-system/pkg/src/date-time/DateField.tsx index fa27a4be3..2d590b755 100644 --- a/design-system/pkg/src/date-time/DateField.tsx +++ b/design-system/pkg/src/date-time/DateField.tsx @@ -45,12 +45,9 @@ function DateField( let { id, ..._descriptionProps } = descriptionProps; descriptionProps = _descriptionProps; } - if (props.errorMessage) { - state = { - ...state, - validationState: 'invalid', - }; - } + // Keep the state object identity intact: React Aria associates the segment + // metadata created by useDateField with this exact object. + let isInvalid = state.isInvalid || Boolean(props.errorMessage); return ( ( fieldProps={fieldProps} isDisabled={isDisabled} autoFocus={autoFocus} - isInvalid={state.isInvalid} + isInvalid={isInvalid} > {state.segments.map((segment, i) => (