Skip to content

Commit 1dd0ef7

Browse files
committed
fix: dismiss keyboard on go-back during LNURLPay flow
1 parent 7f7164a commit 1dd0ef7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/screens/Wallets/LNURLPay/Confirm.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
payLightningInvoice,
3535
} from '../../../utils/lightning';
3636
import { handleLnurlPay } from '../../../utils/lnurl';
37+
import { Keyboard } from '../../../hooks/keyboard';
3738

3839
const Section = memo(
3940
({
@@ -160,6 +161,12 @@ const LNURLConfirm = ({
160161
}
161162
}, [pin, pinForPayments, biometrics, handlePay, navigateToPin]);
162163

164+
const handleGoBack = useCallback(async () => {
165+
// make sure Keyboard is closed before navigating back to prevent layout bugs
166+
await Keyboard.dismiss();
167+
navigation.goBack();
168+
}, [navigation]);
169+
163170
const fixedAmount = pParams.minSendable === pParams.maxSendable;
164171

165172
return (
@@ -173,7 +180,7 @@ const LNURLConfirm = ({
173180
<AmountToggle
174181
style={styles.amountToggle}
175182
amount={amount}
176-
onPress={fixedAmount ? undefined : navigation.goBack}
183+
onPress={fixedAmount ? undefined : handleGoBack}
177184
/>
178185

179186
<View style={styles.sectionContainer}>

0 commit comments

Comments
 (0)