Skip to content

fix: exclude isEditable from DateSegment render prop values #7961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/react-aria-components/src/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,12 @@ export const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function
let {segmentProps} = useDateSegment(segment, state, domRef);
let {focusProps, isFocused, isFocusVisible} = useFocusRing();
let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: state.isDisabled || segment.type === 'literal'});
let {isEditable, ...segmentRest} = segment;
let renderProps = useRenderProps({
...otherProps,
values: {
...segment,
isReadOnly: !segment.isEditable,
...segmentRest,
isReadOnly: !isEditable,
isInvalid: state.isInvalid,
isDisabled: state.isDisabled,
isHovered,
Expand All @@ -355,7 +356,7 @@ export const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function
ref={domRef}
data-placeholder={segment.isPlaceholder || undefined}
data-invalid={state.isInvalid || undefined}
data-readonly={!segment.isEditable || undefined}
data-readonly={!isEditable || undefined}
data-disabled={state.isDisabled || undefined}
data-type={segment.type}
data-hovered={isHovered || undefined}
Expand Down