Skip to content

Commit

Permalink
Allow contract value to be cleared (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwbailey authored and dternyak committed Jul 6, 2018
1 parent 062d251 commit fbe792a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/components/ui/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface Props extends ReactSelectProps {

export default class Dropdown extends React.Component<Props> {
public state = {
selectedOption: { value: '', label: '' },
selectedOption: { value: undefined, label: '' },
hasBlurred: false
};

Expand Down Expand Up @@ -43,13 +43,13 @@ export default class Dropdown extends React.Component<Props> {
});
}
}}
{...this.props}
className={`${this.props.className} ${this.state.hasBlurred ? 'has-blurred' : ''}`}
value={value}
onChange={obj => {
this.handleChange(obj as any);
onChange();
onChange(obj as any);
}}
{...this.props}
onBlur={e => {
this.setState({ hasBlurred: true });
if (this.props && this.props.onBlur) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ class InteractForm extends Component<Props, State> {
abiJson: fullContract.abi || '',
contract
});
} else {
this.props.setCurrentTo('');
this.setState({
abiJson: '',
contract
});
}
};

Expand Down

0 comments on commit fbe792a

Please sign in to comment.