react-native-google-places-autocomplete icon indicating copy to clipboard operation
react-native-google-places-autocomplete copied to clipboard

Added placeholderTextColor as prop

Open AhsanSheikh02 opened this issue 10 months ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.d.ts b/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.d.ts
index 6f5a0bc..f5f826e 100644
--- a/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.d.ts
+++ b/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.d.ts
@@ -1,5 +1,6 @@
 import * as React from 'react';
 import {
+  ColorValue,
   ImageStyle,
   StyleProp,
   TextInput,
@@ -431,6 +432,7 @@ interface GooglePlacesAutocompleteProps {
   /** text input props */
   textInputProps?: TextInputProps | Object;
   timeout?: number;
+  placeholderTextColor?: ColorValue;
 }
 
 export type GooglePlacesAutocompleteRef = {
diff --git a/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.js b/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.js
index 99a2a13..4065bda 100644
--- a/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.js
+++ b/node_modules/react-native-google-places-autocomplete/GooglePlacesAutocomplete.js
@@ -859,6 +859,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
             ]}
             value={stateText}
             placeholder={props.placeholder}
+            placeholderTextColor={props.placeholderTextColor}
             onFocus={
               onFocus
                 ? (e) => {
@@ -923,6 +924,7 @@ GooglePlacesAutocomplete.propTypes = {
   onPress: PropTypes.func,
   onTimeout: PropTypes.func,
   placeholder: 

AhsanSheikh02 avatar Apr 04 '24 02:04 AhsanSheikh02

I would definitely support this being added! currently struggling to adjust the placeholder colour as it's appearing with a very bad contrast on iOS for some users at the moment.

Edit: saying that, i've just found on another issue thread showing the textInputProps prop for the search bar, where you can pass in:

        <GooglePlacesAutocomplete
          // ....
          textInputProps={{ placeholderTextColor: 'red' }}
          // .....
        />

frdwhite24 avatar Apr 07 '24 10:04 frdwhite24