1- import React from 'react' ;
2- import { View } from 'react-native' ;
1+ import React , { useEffect , useState } from 'react' ;
2+ import { InteractionManager , View } from 'react-native' ;
33import Button from '@components/Button' ;
44import HeaderGap from '@components/HeaderGap' ;
55import Text from '@components/Text' ;
66import useLocalize from '@hooks/useLocalize' ;
77import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
88import useThemeStyles from '@hooks/useThemeStyles' ;
9+ import getPlatform from '@libs/getPlatform' ;
10+ import CONST from '@src/CONST' ;
911
1012type TestDriveBannerProps = {
1113 /** Callback to finish the test drive */
@@ -16,9 +18,32 @@ function TestDriveBanner({onPress}: TestDriveBannerProps) {
1618 const styles = useThemeStyles ( ) ;
1719 const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
1820 const { translate} = useLocalize ( ) ;
21+ const [ refreshKey , setRefreshKey ] = useState ( 0 ) ;
22+
23+ // Forcing a key change here forces React to fully re-mount this component
24+ // This helps reset the underlying drag region boundaries so that
25+ // interactive elements (like buttons) become clickable again after certain UI changes.
26+ // Without this, the OS-level drag region overlap clickable elements,
27+ // making them unresponsive until the container is refreshed.
28+ // For more context: https://github.com/Expensify/App/issues/68139
29+ useEffect ( ( ) => {
30+ const isDesktop = getPlatform ( ) === CONST . PLATFORM . DESKTOP ;
31+
32+ if ( ! isDesktop ) {
33+ return ;
34+ }
35+
36+ InteractionManager . runAfterInteractions ( ( ) => {
37+ setRefreshKey ( ( prev ) => prev + 1 ) ;
38+ } ) ;
39+ } , [ ] ) ;
1940
2041 return (
21- < View style = { styles . highlightBG } >
42+ < View
43+ style = { [ styles . highlightBG ] }
44+ dataSet = { { dragArea : false } }
45+ key = { refreshKey }
46+ >
2247 < HeaderGap styles = { styles . testDriveBannerGap } />
2348 < View style = { [ styles . gap2 , styles . alignItemsCenter , styles . flexRow , styles . justifyContentCenter , styles . h10 ] } >
2449 < Text >
0 commit comments