You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Material UI package has a readOnly property that "prevents the user from changing the value of the field (not from interacting with the field).". However, all the widgets in the RJSF material package set the fields as disabled (grey out), with no interaction. Looking into the code I see they all have something like this:
<TextFieldid={id}label={label||schema.title}autoFocus={autofocus}required={required}disabled={disabled||readonly}name={name}type={schema.typeasstring}value={value ? value : ''}onChange={_onChange}onBlur={_onBlur}onFocus={_onFocus}/>
The fix is simple, they just need to be changed to:
This is related to #1647 (which I already offered to open PR for, but got no response for my suggestion there). There are more fields (not just the readonly), which are supported by material-ui, and there should be a generic way to have access to them.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.
Prerequisites
Description
The Material UI package has a readOnly property that "prevents the user from changing the value of the field (not from interacting with the field).". However, all the widgets in the RJSF material package set the fields as disabled (grey out), with no interaction. Looking into the code I see they all have something like this:
The fix is simple, they just need to be changed to:
I would fix this myself, however due to problems outlined here I am unable to :(
Expected behavior
Setting a field to readonly, would make it readonly not disabled.
Actual behavior
Setting a field to readonly makes it disabled.
The text was updated successfully, but these errors were encountered: