Skip to content

Commit 1fb4579

Browse files
committed
fix:65746: added Keyboard.dismiss on tab change in Create Expense
1 parent be5512e commit 1fb4579

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/components/SelectionList/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ function SelectionList<TItem extends ListItem>({onScroll, shouldHideKeyboardOnSc
5858

5959
// In SearchPageBottomTab we use useAnimatedScrollHandler from reanimated(for performance reasons) and it returns object instead of function. In that case we cannot change it to a function call, that's why we have to choose between onScroll and defaultOnScroll.
6060
const defaultOnScroll = () => {
61-
// Only dismiss the keyboard whenever the user scrolls the screen
62-
if (!isScreenTouched) {
63-
return;
64-
}
65-
66-
if (!shouldHideKeyboardOnScroll) {
61+
// Only dismiss the keyboard whenever the user scrolls the screen or `shouldHideKeyboardOnScroll` is true
62+
if (!isScreenTouched || !shouldHideKeyboardOnScroll) {
6763
return;
6864
}
6965
Keyboard.dismiss();

src/pages/iou/request/IOURequestStartPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useFocusEffect} from '@react-navigation/native';
22
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
3-
import {View} from 'react-native';
3+
import {Keyboard, View} from 'react-native';
44
import DragAndDropProvider from '@components/DragAndDrop/Provider';
55
import FocusTrapContainerElement from '@components/FocusTrap/FocusTrapContainerElement';
66
import HeaderWithBackButton from '@components/HeaderWithBackButton';
@@ -115,6 +115,7 @@ function IOURequestStartPage({
115115

116116
const resetIOUTypeIfChanged = useCallback(
117117
(newIOUType: IOURequestType) => {
118+
Keyboard.dismiss();
118119
if (transaction?.iouRequestType === newIOUType) {
119120
return;
120121
}

0 commit comments

Comments
 (0)