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

textInput value not showing android #177

Open
omererbil opened this issue May 13, 2020 · 4 comments · May be fixed by #181
Open

textInput value not showing android #177

omererbil opened this issue May 13, 2020 · 4 comments · May be fixed by #181

Comments

@omererbil
Copy link

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 omererbil reopened this May 15, 2020
@hiphotels
Copy link

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

Have you found a solution?

Screenshot_1595583484

@hiphotels
Copy link

hiphotels commented Jul 24, 2020

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"
      />

@alpha0010
Copy link
Contributor

alpha0010 commented Aug 24, 2020

[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 added a commit to alpha0010/react-native-search-bar that referenced this issue Aug 24, 2020
@alpha0010 alpha0010 linked a pull request Aug 24, 2020 that will close this issue
@mrsrhn
Copy link

mrsrhn commented Dec 27, 2021

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

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

Successfully merging a pull request may close this issue.

4 participants