-
Notifications
You must be signed in to change notification settings - Fork 4.8k
DataForm: support disabled controls #77090
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
Changes from 7 commits
260d810
1f560e5
c616933
772836f
5613289
eb71d70
06515fb
2c39a1c
01a199b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ export default function Radio< Item >( { | |
| validity, | ||
| }: DataFormControlProps< Item > ) { | ||
| const { label, description, getValue, setValue, isValid } = field; | ||
| const disabled = field.isDisabled( { item: data, field } ); | ||
| const { elements, isLoading } = useElements( { | ||
| elements: field.elements, | ||
| getElements: field.getElements, | ||
|
|
@@ -50,6 +51,7 @@ export default function Radio< Item >( { | |
| options={ elements } | ||
| selected={ value } | ||
| hideLabelFromVision={ hideLabelFromVision } | ||
| disabled={ disabled } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR for this at #77127 |
||
| /> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ export default function Textarea< Item >( { | |
| validity, | ||
| }: DataFormControlProps< Item > ) { | ||
| const { rows = 4 } = config || {}; | ||
| const disabled = field.isDisabled( { item: data, field } ); | ||
| const { label, placeholder, description, setValue, isValid } = field; | ||
| const value = field.getValue( { item: data } ); | ||
|
|
||
|
|
@@ -43,6 +44,7 @@ export default function Textarea< Item >( { | |
| help={ description } | ||
| onChange={ onChangeControl } | ||
| rows={ rows } | ||
| disabled={ disabled } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While the control is actually disabled, the styles do not communicate the state: Screen.Recording.2026-04-07.at.10.56.46.mov
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix for the styles at #77129 |
||
| minLength={ | ||
| isValid.minLength ? isValid.minLength.constraint : undefined | ||
| } | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something wrong with the checkbok. It disappears when disabled?
Screen.Recording.2026-04-07.at.10.47.14.mov
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was hidden due to a bug in the story that it's now fixed. Though it has the same issue than radio and textarea: it's disabled but the styles do not reflect that state
Screen.Recording.2026-04-07.at.13.20.41.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix at #77132