React-native-google-places-autocomplete: Placeholder color on iphone gen 12

Created on 30 Mar 2021  路  4Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Placeholder color on iphone gen 12 is white and on iphone gen 8 is gray can u help me?

google auto complete (1)

Code

<GooglePlacesAutocomplete
      ref={inputRef}
      placeholder={placeholder || i18n.placeholders.deliveryAddressPlaceholder}
      fetchDetails={true}
      enablePoweredByContainer={false}
      onPress={onPressAddressRow}
      GooglePlacesDetailsQuery={{
        fields: ['address_components', 'formatted_address']
      }}
      query={{
        key: MAPS_KEY,
        language: 'xxx',
        components: 'country:xxx',
        types: ['address']
      }}
      listUnderlayColor={colors.white}
      styles={{
        textInputContainer: {
          borderColor: colors.brownishGrey,
          borderWidth: 0.4,
          backgroundColor: colors.white,
          borderRadius: 5,
          paddingHorizontal: spacing.xxsmall,
          height: 46,
          fontSize: fontSize.regular,
          marginBottom: spacing.small
        },
        textInput: {
          fontSize: fontSize.regular
        },
        row: {
          borderBottomColor: colors.white
        },
        predefinedPlacesDescription: {
          color: colors.black
        }
      }}
      renderRow={renderRow}
      renderLeftButton={() => renderLeftInputIncon()}
    />

Additional context

  • Library Version: [e.g. 2.2.0]
  • React Native Version: [e.g. 0.63.3]

  • [x] iOS

  • [ ] Android
  • [ ] Web

If you are using expo please indicate here:

  • [ ] I am using expo

Add any other context about the problem here, screenshots etc

bug

Most helpful comment

@jretamalc you can update the placeholder color by passing in the option to textInputProps

e.g.

<GooglePlacesAutocomplete
   textInputProps={{
      placeholderTextColor: Colors.primary,
   }}
   // other props
/>

Check out the TextInput props section for reference to other props you can use. https://reactnative.dev/docs/textinput#props

All 4 comments

In android 11 too

It is happening to me too. iPhone 12.

In android 8 and 9 too, is there any other way to modify the placeholder color?

@jretamalc you can update the placeholder color by passing in the option to textInputProps

e.g.

<GooglePlacesAutocomplete
   textInputProps={{
      placeholderTextColor: Colors.primary,
   }}
   // other props
/>

Check out the TextInput props section for reference to other props you can use. https://reactnative.dev/docs/textinput#props

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DennisMuchiri picture DennisMuchiri  路  4Comments

yashwanth15 picture yashwanth15  路  3Comments

KhalilKhalaf picture KhalilKhalaf  路  4Comments

diegothucao picture diegothucao  路  3Comments

aymkin picture aymkin  路  4Comments