Skip to content

Commit

Permalink
Merge pull request #43976 from truph01/fix/43650
Browse files Browse the repository at this point in the history
Fix: Send button does not response
  • Loading branch information
luacmartins authored Jun 20, 2024
2 parents ff1ccf6 + 26e1327 commit a15edb6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/home/report/ReportActionCompose/SendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as Expensicons from '@components/Icon/Expensicons';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import Tooltip from '@components/Tooltip';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
Expand All @@ -22,7 +23,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();

const {isSmallScreenWidth} = useResponsiveLayout();
const Tap = Gesture.Tap().onEnd(() => {
handleSendMessage();
});
Expand All @@ -33,7 +34,12 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
// Keep focus on the composer when Send message is clicked.
onMouseDown={(e) => e.preventDefault()}
>
<GestureDetector gesture={Tap}>
<GestureDetector
// A new GestureDetector instance must be created when switching from a large screen to a small screen
// if not, the GestureDetector may not function correctly.
key={`send-button-${isSmallScreenWidth ? 'small-screen' : 'normal-screen'}`}
gesture={Tap}
>
<Tooltip text={translate('common.send')}>
<PressableWithFeedback
style={({pressed, isDisabled}) => [
Expand Down

0 comments on commit a15edb6

Please sign in to comment.