Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
[Consignment] Check if optional functions exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Apr 2, 2019
1 parent ee198eb commit e59bccf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/lib/Components/Consignments/Components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,18 @@ export default class TextInputField extends React.Component<TextInputProps, Stat
placeholderTextColor={this.state.focused ? "white" : Colors.GraySemibold}
selectionColor={Colors.GrayMedium}
{...this.props.text}
onFocus={e => this.setState({ focused: true }, () => this.props.text.onFocus(e))}
onBlur={e => this.setState({ focused: false }, () => this.props.text.onBlur(e))}
onFocus={e =>
this.setState(
{ focused: true },
() => this.props.text && this.props.text.onFocus && this.props.text.onFocus(e)
)
}
onBlur={e =>
this.setState(
{ focused: false },
() => this.props.text && this.props.text.onBlur && this.props.text.onBlur(e)
)
}
/>
)}

Expand Down

0 comments on commit e59bccf

Please sign in to comment.