Skip to content

Commit

Permalink
Merge pull request #33421 from mkhutornyi/fix-32715
Browse files Browse the repository at this point in the history
dismiss keyboard on Choose SSO or MagicCode page
  • Loading branch information
aldo-expensify authored Jan 3, 2024
2 parents b81690d + 034e93d commit 21894f4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pages/signin/ChooseSSOOrMagicCode.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import React, {useEffect} from 'react';
import {Keyboard, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Button from '@components/Button';
import FormHelpMessage from '@components/FormHelpMessage';
import Text from '@components/Text';
import useKeyboardState from '@hooks/useKeyboardState';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -54,10 +55,19 @@ const defaultProps = {

function ChooseSSOOrMagicCode({credentials, account, setIsUsingMagicCode}) {
const styles = useThemeStyles();
const {isKeyboardShown} = useKeyboardState();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const {isSmallScreenWidth} = useWindowDimensions();

// This view doesn't have a field for user input, so dismiss the device keyboard if shown
useEffect(() => {
if (!isKeyboardShown) {
return;
}
Keyboard.dismiss();
}, [isKeyboardShown]);

return (
<>
<View>
Expand Down

0 comments on commit 21894f4

Please sign in to comment.