-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix/ O3-2253:Marking a field as readonly should render the field control as opposed to switching to view mode #114
Conversation
@samuelmale @ibacher there is an issue with the carbon radio component ignoring the readOnly attribute passed to it, perhaps it has to do with the carbon version... |
@arodidev That's nothing to do with Carbon. The underlying HTML input element doesn't support a |
@ibacher I agree there is no native support for |
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.
LGTM
@samuelmale Yeah, I missed that when I looked at Storybook earlier. The |
@ibacher you're correct, but it doesn't work with our supported Carbon version. |
@samuelmale True... but we could always just add the "do nothing" on change handler if the field is set to read-only right? |
@ibacher that's a brilliant idea but assuming the radio buttons remain interactive, wouldn't this confuse the users? |
That's true. We could also add the same Sass rule that gets applied: @use "@carbon/colors";
.cds--radio-button-group--readonly
.cds--radio-button
+ .cds-radio-button__label
.cds--radio-button__appearance {
border-color: colors.$icon-disabled;
}
.cds--radio-button-group--readonly .#{$prefix}--radio-button__label {
cursor: default;
}
.cds--radio-button-group--readonly
.cds--radio-button__label-text {
cursor: text;
user-select: text;
} Then just add the The important thing there is it sets the |
Requirements
Summary
In "edit" and "enter" mode, the fields marked as read-only should render the controlled in readOnly mode and not the default view mode display
Screenshots
Related Issue
Link to community ticket: https://issues.openmrs.org/browse/O3-2303
Other