Skip to content

Commit 5aded31

Browse files
committed
Add isReadonly and isRequired to renderProps
1 parent 6c2787b commit 5aded31

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/react-aria-components/src/ColorField.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ export interface ColorFieldRenderProps {
4444
* @selector [data-invalid]
4545
*/
4646
isInvalid: boolean,
47+
/**
48+
* Whether the color field is read only.
49+
* @selector [data-readonly]
50+
*/
51+
isReadOnly: boolean,
52+
/**
53+
* Whether the color field is required.
54+
* @selector [data-required]
55+
*/
56+
isRequired: boolean,
4757
/**
4858
* The color channel that this field edits, or "hex" if no `channel` prop is set.
4959
* @selector [data-channel="hex | hue | saturation | ..."]
@@ -192,7 +202,9 @@ function useChildren(
192202
state,
193203
channel: props.channel || 'hex',
194204
isDisabled: props.isDisabled || false,
195-
isInvalid: validation.isInvalid || false
205+
isInvalid: validation.isInvalid || false,
206+
isReadOnly: props.isReadOnly || false,
207+
isRequired: props.isRequired || false
196208
},
197209
defaultClassName: 'react-aria-ColorField'
198210
});

0 commit comments

Comments
 (0)