From f258a27a83a2508c3cd6c7cb823b56ed18783be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Mi=C3=B1o?= Date: Fri, 24 May 2019 20:44:23 -0400 Subject: [PATCH] Bugfix: close dropdowns on scan qr (#671) * close dropdowns * snapshots --- app/components/UI/AccountInput/index.js | 9 +++++++-- .../UI/TransactionEdit/__snapshots__/index.test.js.snap | 1 + app/components/UI/TransactionEdit/index.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/components/UI/AccountInput/index.js b/app/components/UI/AccountInput/index.js index d39cbd82e70..db6c46c309f 100644 --- a/app/components/UI/AccountInput/index.js +++ b/app/components/UI/AccountInput/index.js @@ -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 = { @@ -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(); } } }); diff --git a/app/components/UI/TransactionEdit/__snapshots__/index.test.js.snap b/app/components/UI/TransactionEdit/__snapshots__/index.test.js.snap index f5a2ea925f0..32a81f9e4ee 100644 --- a/app/components/UI/TransactionEdit/__snapshots__/index.test.js.snap +++ b/app/components/UI/TransactionEdit/__snapshots__/index.test.js.snap @@ -189,6 +189,7 @@ exports[`TransactionEdit should render correctly 1`] = `