Skip to content

Commit a0879f5

Browse files
committed
chore: update readme and align props order
1 parent 503be03 commit a0879f5

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,19 @@ const PlaceDetailsExample = () => {
182182
```
183183
</details>
184184

185+
<details>
186+
<summary>Example with scroll configuration</summary>
187+
188+
```javascript
189+
<GooglePlacesTextInput
190+
apiKey="YOUR_GOOGLE_PLACES_API_KEY"
191+
onPlaceSelect={handlePlaceSelect}
192+
scrollEnabled={false}
193+
nestedScrollEnabled={false}
194+
/>
195+
```
196+
</details>
197+
185198
## Props
186199

187200
| Prop | Type | Required | Default | Description |
@@ -210,6 +223,8 @@ const PlaceDetailsExample = () => {
210223
| forceRTL | boolean | No | - | Force RTL layout (auto-detected if not provided) |
211224
| style | GooglePlacesTextInputStyles | No | {} | Custom styling object |
212225
| hideOnKeyboardDismiss | boolean | No | false | Hide suggestions when keyboard is dismissed |
226+
| scrollEnabled | boolean | No | true | Enable/disable scrolling in the suggestions list |
227+
| nestedScrollEnabled | boolean | No | true | Enable/disable nested scrolling for the suggestions list |
213228
| **Error Handling & Debugging** |
214229
| onError | (error: any) => void | No | - | Callback when API errors occur |
215230
| enableDebug | boolean | No | false | Enable detailed console logging for troubleshooting |

src/GooglePlacesTextInput.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,23 @@ interface GooglePlacesTextInputProps {
8080
languageCode?: string;
8181
includedRegionCodes?: string[];
8282
types?: string[];
83-
biasPrefixText?: (text: string) => string; // ✅ Function that transforms text
83+
biasPrefixText?: (text: string) => string;
8484
minCharsToFetch?: number;
85-
onPlaceSelect: (place: Place, sessionToken?: string | null) => void; // ✅ Remove | null
85+
onPlaceSelect: (place: Place, sessionToken?: string | null) => void;
8686
onTextChange?: (text: string) => void;
8787
debounceDelay?: number;
8888
showLoadingIndicator?: boolean;
8989
showClearButton?: boolean;
9090
forceRTL?: boolean;
9191
style?: GooglePlacesTextInputStyles;
9292
hideOnKeyboardDismiss?: boolean;
93+
scrollEnabled?: boolean;
94+
nestedScrollEnabled?: boolean;
9395
fetchDetails?: boolean;
94-
detailsProxyUrl?: string | null; // ✅ Add | null to match JS
96+
detailsProxyUrl?: string | null;
9597
detailsFields?: string[];
9698
onError?: (error: any) => void;
97-
enableDebug?: boolean; // ✅ Add debug prop
98-
scrollEnabled?: boolean;
99-
nestedScrollEnabled?: boolean;
99+
enableDebug?: boolean;
100100
}
101101

102102
interface GooglePlacesTextInputRef {
@@ -132,13 +132,13 @@ const GooglePlacesTextInput = forwardRef<
132132
forceRTL = undefined,
133133
style = {},
134134
hideOnKeyboardDismiss = false,
135+
scrollEnabled = true,
136+
nestedScrollEnabled = true,
135137
fetchDetails = false,
136138
detailsProxyUrl = null,
137139
detailsFields = [],
138140
onError,
139141
enableDebug = false,
140-
scrollEnabled = true,
141-
nestedScrollEnabled = true,
142142
},
143143
ref
144144
) => {
@@ -581,10 +581,10 @@ const GooglePlacesTextInput = forwardRef<
581581
renderItem={renderSuggestion}
582582
keyExtractor={(item) => item.placePrediction.placeId}
583583
keyboardShouldPersistTaps="always"
584-
style={style.suggestionsList}
585584
scrollEnabled={scrollEnabled}
586-
bounces={false}
587585
nestedScrollEnabled={nestedScrollEnabled}
586+
bounces={false}
587+
style={style.suggestionsList}
588588
/>
589589
</View>
590590
)}

0 commit comments

Comments
 (0)