-
Notifications
You must be signed in to change notification settings - Fork 429
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
[all] Adding support for and styling readOnly fields. #440 #574
Conversation
0858048
to
09a9f0c
Compare
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.
Got a few comments, apart from that this looks very good
@@ -45,7 +45,7 @@ export default class RadioSelect extends React.Component { | |||
} | |||
|
|||
render() { | |||
const {items, value, name, direction} = this.props | |||
const {items, value, name, direction, readOnly} = this.props |
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.
readOnly
is missing in props validation
@@ -174,13 +177,13 @@ export default class StatelessSearchableSelect extends React.PureComponent { | |||
) | |||
} | |||
{ | |||
onClear && value && ( | |||
onClear && value && !this.props.readOnly && ( |
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 would be better to destruct readOnly
along with the rest of the props
<button type="button" className={styles.clearButton} onClick={onClear}> | ||
<CloseIcon color="inherit" /> | ||
</button> | ||
) | ||
} | ||
{!isLoading && ( | ||
{!isLoading && !this.props.readOnly && ( |
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.
Access the destructed variable here too
09a9f0c
to
97ce18e
Compare
1ab80aa
to
afcff27
Compare
I think this is good to merge now. I've made sure the |
- Inherit readOnly on container type inputs - Support visual readOnly state on image types
e936ef5
to
f82c45a
Compare
Not ready to merge yet.
Needs to pass down
readOnly
to children of array and objects. (@bjoerge)