Skip to content

Commit

Permalink
Bugfix: close dropdowns on scan qr (#671)
Browse files Browse the repository at this point in the history
* close dropdowns

* snapshots
  • Loading branch information
estebanmino authored May 25, 2019
1 parent 5201e35 commit 7eff520
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/components/UI/AccountInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ class AccountInput extends Component {
/**
* Map representing the address book
*/
addressBook: PropTypes.array
addressBook: PropTypes.array,
/**
* Callback close all drowpdowns
*/
closeDropdowns: PropTypes.func
};

state = {
Expand Down Expand Up @@ -345,13 +349,14 @@ class AccountInput extends Component {
};

scan = () => {
const { openAccountSelect } = this.props;
const { openAccountSelect, closeDropdowns } = this.props;
openAccountSelect && openAccountSelect(false);
this.setState({ isOpen: false });
this.props.navigation.navigate('QRScanner', {
onScanSuccess: meta => {
if (meta.target_address) {
this.onChange(meta.target_address);
closeDropdowns && closeDropdowns();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ exports[`TransactionEdit should render correctly 1`] = `
</View>
<Connect(AccountInput)
address="0x2"
closeDropdowns={[Function]}
isOpen={false}
navigation={
Object {
Expand Down
1 change: 1 addition & 0 deletions app/components/UI/TransactionEdit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class TransactionEdit extends Component {
onFocus={this.onFocusToAddress}
placeholder={strings('transaction.recipient_address')}
showQRScanner={this.onScan}
closeDropdowns={this.closeDropdowns}
address={to}
updateToAddressError={this.updateToAddressError}
ensRecipient={ensRecipient}
Expand Down

0 comments on commit 7eff520

Please sign in to comment.