react-native-search-bar icon indicating copy to clipboard operation
react-native-search-bar copied to clipboard

textInput value not showing android

Open omererbil opened this issue 4 years ago • 4 comments

textInput value not showing when typying in android my app forced to use RTL, typing in RTL works good but in LTR not showing only after fast-refresh LTR typing is showing

react-native 0.61 react-native-search-bar 3.5.1

omererbil avatar May 13 '20 11:05 omererbil

Hey. I'm having the same issue on Android. The text input is not visible.

Have you found a solution?

Screenshot_1595583484

hiphotels avatar Jul 24 '20 09:07 hiphotels

I had a look at the source code and you can pass the prop textColor. This works for me.

<SearchBar
        ref={searchBar}
        placeholder="Search"
        onChangeText={(text) => onChangeText(text)}
        onSearchButtonPress={(text) => onSearchButtonPress(text)}
        onCancelButtonPress={onCancelButtonPress}
        textColor="black"
      />

hiphotels avatar Jul 24 '20 09:07 hiphotels

[Edit] Change of color handling behavior in react native core.

~~For future debugging purposes, my guess is something fails while retrieving the native ColorStateList. (We need the ColorStateList for proper look/feel when the search bar is unfocused or not editable.)~~

https://github.com/umhan35/react-native-search-bar/blob/v3.5.1/android/src/main/java/org/umhan35/RNSearchBarManager.java#L154-L156

final int[] attrs = {android.R.attr.textColorPrimary};
final TypedArray a = searchView.getContext().obtainStyledAttributes(0, attrs);
colorList = a.getColorStateList(0);

alpha0010 avatar Aug 24 '20 21:08 alpha0010

@umhan35 would be really nice if you could merge the pull request

mrsrhn avatar Dec 27 '21 17:12 mrsrhn