Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added placeholderTextColor as prop #935

Open
AhsanSheikh02 opened this issue Apr 4, 2024 · 1 comment
Open

Added placeholderTextColor as prop #935

AhsanSheikh02 opened this issue Apr 4, 2024 · 1 comment

Comments

@AhsanSheikh02
Copy link

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: 
@frdwhite24
Copy link

frdwhite24 commented Apr 7, 2024

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' }}
          // .....
        />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants