1- import { SafeAreaView , StyleSheet , View , Text } from 'react-native' ;
1+ import { SafeAreaView , StyleSheet , View , Text , ScrollView } from 'react-native' ;
22import GooglePlacesTextInput from 'react-native-google-places-textinput' ;
33
44const App = ( ) => {
@@ -65,6 +65,7 @@ const App = () => {
6565
6666 return (
6767 < SafeAreaView style = { styles . container } >
68+ { /* Basic usage example with minimal configuration */ }
6869 < View style = { styles . section } >
6970 < Text style = { styles . sectionTitle } > Basic Example</ Text >
7071 < GooglePlacesTextInput
@@ -76,6 +77,7 @@ const App = () => {
7677 />
7778 </ View >
7879
80+ { /* Example showing custom styling and filtered place types */ }
7981 < View style = { styles . section } >
8082 < Text style = { styles . sectionTitle } > Styled Example</ Text >
8183 < GooglePlacesTextInput
@@ -90,6 +92,7 @@ const App = () => {
9092 />
9193 </ View >
9294
95+ { /* Example demonstrating how to fetch detailed place information */ }
9396 < View style = { styles . section } >
9497 < Text style = { styles . sectionTitle } > Place Details Example</ Text >
9598 < GooglePlacesTextInput
@@ -139,23 +142,29 @@ const App = () => {
139142 />
140143 </ View >
141144
145+ { /* This example shows how to properly integrate GooglePlacesTextInput inside a vertical ScrollView */ }
142146 < View style = { styles . section } >
143- < Text style = { styles . sectionTitle } > Scroll Disabled Example</ Text >
144- < GooglePlacesTextInput
145- apiKey = "YOUR_API_KEY_HERE"
146- placeHolderText = "Try scrolling these results"
147- onPlaceSelect = { ( place ) => {
148- console . log ( 'Scroll disabled example, selected:' , place ) ;
149- } }
150- scrollEnabled = { false }
151- nestedScrollEnabled = { false }
152- style = { {
153- container : {
154- width : '100%' ,
155- paddingHorizontal : 16 ,
156- } ,
157- } }
158- />
147+ < ScrollView
148+ keyboardShouldPersistTaps = "handled"
149+ nestedScrollEnabled = { true }
150+ >
151+ < Text style = { styles . sectionTitle } > Scroll Disabled Example</ Text >
152+ < GooglePlacesTextInput
153+ apiKey = "YOUR_API_KEY_HERE"
154+ placeHolderText = "Try scrolling these results"
155+ onPlaceSelect = { ( place ) => {
156+ console . log ( 'Scroll disabled example, selected:' , place ) ;
157+ } }
158+ scrollEnabled = { false }
159+ nestedScrollEnabled = { false }
160+ style = { {
161+ container : {
162+ width : '100%' ,
163+ paddingHorizontal : 16 ,
164+ } ,
165+ } }
166+ />
167+ </ ScrollView >
159168 </ View >
160169 </ SafeAreaView >
161170 ) ;
0 commit comments