Skip to content

Commit a15edb6

Browse files
authored
Merge pull request #43976 from truph01/fix/43650
Fix: Send button does not response
2 parents ff1ccf6 + 26e1327 commit a15edb6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pages/home/report/ReportActionCompose/SendButton.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as Expensicons from '@components/Icon/Expensicons';
66
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
77
import Tooltip from '@components/Tooltip';
88
import useLocalize from '@hooks/useLocalize';
9+
import useResponsiveLayout from '@hooks/useResponsiveLayout';
910
import useTheme from '@hooks/useTheme';
1011
import useThemeStyles from '@hooks/useThemeStyles';
1112
import CONST from '@src/CONST';
@@ -22,7 +23,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
2223
const theme = useTheme();
2324
const styles = useThemeStyles();
2425
const {translate} = useLocalize();
25-
26+
const {isSmallScreenWidth} = useResponsiveLayout();
2627
const Tap = Gesture.Tap().onEnd(() => {
2728
handleSendMessage();
2829
});
@@ -33,7 +34,12 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
3334
// Keep focus on the composer when Send message is clicked.
3435
onMouseDown={(e) => e.preventDefault()}
3536
>
36-
<GestureDetector gesture={Tap}>
37+
<GestureDetector
38+
// A new GestureDetector instance must be created when switching from a large screen to a small screen
39+
// if not, the GestureDetector may not function correctly.
40+
key={`send-button-${isSmallScreenWidth ? 'small-screen' : 'normal-screen'}`}
41+
gesture={Tap}
42+
>
3743
<Tooltip text={translate('common.send')}>
3844
<PressableWithFeedback
3945
style={({pressed, isDisabled}) => [

0 commit comments

Comments
 (0)