From 7edcbbeff0207a614188090ef812cbfca1050938 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 15 Sep 2023 03:25:02 +0530 Subject: [PATCH 1/2] fix: autoFocus for payment input in safari. Signed-off-by: Krishna Gupta --- src/libs/Navigation/OnyxTabNavigator.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libs/Navigation/OnyxTabNavigator.js b/src/libs/Navigation/OnyxTabNavigator.js index dc68021bf515..56b820f5e05b 100644 --- a/src/libs/Navigation/OnyxTabNavigator.js +++ b/src/libs/Navigation/OnyxTabNavigator.js @@ -4,6 +4,8 @@ import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import Tab from '../actions/Tab'; import ONYXKEYS from '../../ONYXKEYS'; +import * as Browser from '../Browser'; +import CONST from '../../CONST'; const propTypes = { /* ID of the tab component to be saved in onyx */ @@ -23,6 +25,10 @@ const defaultProps = { // eslint-disable-next-line rulesdir/no-inline-named-export export const TopTab = createMaterialTopTabNavigator(); +// Will set this for all platforms once issue below is fixed for native devices. +// https://github.com/Expensify/App/issues/27117 +const keyboardDismissModeProp = Browser.getBrowser() === CONST.BROWSER.SAFARI ? {keyboardDismissMode: 'none'} : {}; + // This takes all the same props as MaterialTopTabsNavigator: https://reactnavigation.org/docs/material-top-tab-navigator/#props, // except ID is now required, and it gets a `selectedTab` from Onyx function OnyxTabNavigator({id, selectedTab, children, ...rest}) { @@ -30,6 +36,8 @@ function OnyxTabNavigator({id, selectedTab, children, ...rest}) { Date: Sat, 16 Sep 2023 13:28:55 +0530 Subject: [PATCH 2/2] fix: removed check for safari only. Signed-off-by: Krishna Gupta --- src/libs/Navigation/OnyxTabNavigator.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libs/Navigation/OnyxTabNavigator.js b/src/libs/Navigation/OnyxTabNavigator.js index 56b820f5e05b..2782054497b0 100644 --- a/src/libs/Navigation/OnyxTabNavigator.js +++ b/src/libs/Navigation/OnyxTabNavigator.js @@ -4,8 +4,6 @@ import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import Tab from '../actions/Tab'; import ONYXKEYS from '../../ONYXKEYS'; -import * as Browser from '../Browser'; -import CONST from '../../CONST'; const propTypes = { /* ID of the tab component to be saved in onyx */ @@ -25,10 +23,6 @@ const defaultProps = { // eslint-disable-next-line rulesdir/no-inline-named-export export const TopTab = createMaterialTopTabNavigator(); -// Will set this for all platforms once issue below is fixed for native devices. -// https://github.com/Expensify/App/issues/27117 -const keyboardDismissModeProp = Browser.getBrowser() === CONST.BROWSER.SAFARI ? {keyboardDismissMode: 'none'} : {}; - // This takes all the same props as MaterialTopTabsNavigator: https://reactnavigation.org/docs/material-top-tab-navigator/#props, // except ID is now required, and it gets a `selectedTab` from Onyx function OnyxTabNavigator({id, selectedTab, children, ...rest}) { @@ -36,11 +30,10 @@ function OnyxTabNavigator({id, selectedTab, children, ...rest}) { { const state = event.data.state;