Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
光弘 committed Sep 4, 2018
1 parent f12eb3a commit e707d91
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/PickableFormField.jsx
Expand Up @@ -40,7 +40,9 @@ class PickableFormField extends FormField {

renderChildren() {
const me = this;
const { prefixCls, type, children, max } = me.props;
const {
prefixCls, type, children, max,
} = me.props;

const rendered = React.Children.map(children, (child, index) => React.cloneElement(child, {
prefixCls: `${prefixCls}-item`,
Expand All @@ -67,14 +69,21 @@ class PickableFormField extends FormField {
onChange={me.handleChange}
value={me.state.value || []}
{...propsObj}
>{me.renderChildren()}</Pickable>
>
{me.renderChildren()}

</Pickable>,
);
} else if (mode === Constants.MODE.VIEW) {
if (me.state.value) {
me.state.value.forEach((val) => {
React.Children.map(me.props.children, (child, i) => {
if (child.props.value === val) {
arr.push(<span key={i} style={{ marginRight: '10px' }}>{child.props.children}</span>);
arr.push(
<span key={i} style={{ marginRight: '10px' }}>
{child.props.children}
</span>,
);
}
});
});
Expand Down

0 comments on commit e707d91

Please sign in to comment.