-
Notifications
You must be signed in to change notification settings - Fork 255
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
Autocomplete suggestions are not displaying (Android) #20
Comments
I also have same issue. If you solved it, let me know. I waste many time for fixing this issue. |
Thanks for reporting the issue! Android is such a PITA. Tried to run it in the emulator ether the app or the emulator os constantly crashing. As soon I have some more time I will investigate further. |
Thanks @l-urence, I appreciate it. Until the fix is released, is there another branch or version you could point us to that works for Android? |
@edwinjue Maybe try to install v1.1.2 |
@l-urence, it works! But the "Autocomplete" component must be enclosed in a "View" component with style={{zIndex:1}} as per solution to #21. Please keep us updated when the fix is released. Thanks again buddy |
@edwinjue good to now. I will try to fix this latest next weekend. |
The problem with Android is that it doesn't support overflows (or at least not in RN). This is the reason why there is no suggestion list popping-up, because it is hidden by the parent view. Right now the best solution to go with Android is to use the v1.1.2 release until overflows are supported by RN for Android. |
Thanks @l-urence. v1.1.2 works pretty well actually. |
I'm afraid it's not possible to solve this using a single component. The dropdown list needs to be neighbour to the TextInput in order to be able to overlap other content. I don't think this will change in upcoming versions of RN. |
@fab1an just for Android? In iOS this works well. |
Android has a very different rendering system than iOS. |
If Autocomplete is sibling of other views it does not either:
Had to add zIndex to listStyle and containerStyle because other siblings would overlap it. |
How about using - https://gist.github.com/tioback/6af21db0685cd3b1de28b84981f31cca as suggested here - facebook/react-native#6802 |
v3.0.0 will simplify the integration into Android. I will close this issue for now, because this is not going to change until there is some kind of support for overflows in RN for Android. |
I'm still facing issue making it work, I'd appreciate if anyone can spot where I'm going wrong, auto complete list is displaying inside the container view and not outside of it. Working as expected on iOS This is my code:
Card Row style:
contentContainer Style:
|
I added this line to the Autocomplete props, and it worked like a charm, hope this works for you too!
|
It was my messed up view, fixed my views layout and now all is working, sorry for false alarm :) |
Is the absolute positioning for Android in docs and examples in this repo still relevant? I see that overflow support has been added since RN 0.57: facebook/react-native@b81c8b5 |
Not working if it is put inside a parent component and the parent component has a sibling below it, even if autocomplete input's parent has position: absolute and zIndex set. Please reopen issue. |
I have tried every possible solution, suggested here. My Component is working fine on ios. But on android list is showing , i can't click. TouchableOpacity is not working. Instead the scroll is getting all the touch events, and other components. Any help would be much appreciated. |
Me too, any update on this? I'm still waiting for the final solution. |
same here, android fixes makes the options not clickable. |
Same here :( |
same |
1 similar comment
same |
Suggestions were not showing either. My example here : renderTextInput={(text) => ( I hope it does the job for you too |
I also have the same problem, can some one reopen this issue |
Bump - @mrlaessig any updates on this issue? Adding above suggestions and still cant select a list item on Android |
the same |
@mrlaessig @IvanTrutnev yes I managed to get it to work using different styles for iOS and android. For iOS follow normal guide and for android make sure your container has position relative and set an implicit height, then your inner container should have position absolute: |
This workaround might fit for some. The approach is to grow the height of the parent view together with the result List. It behaves a little bit like an accordion then. I had the best behaviour, when giving the listContainerStyle and listStyle a fixed height. If you need to have the result list as a real overlay, it is not an option. <View style={[hideResults ? {height: 90} : {height: 280}]}> showResultCheck (){ changeValue(text){ In this way the result List does not Interfere with any touchable element in the background. |
This issue was opened in 2016 and it is now 2021 and the issue is still occurring. There needs to be a clear and concise fix. Like others have said, it appears that you can't click on an item on Android, whereas it works fine on iOS. |
@rabidkitten I checked this with example and it works at least on an emulator. |
@mrlaessig I had the latest and I used the android emulator as well and I couldn't click or tap on an item. The drop down was working, but I couldn't select an item by tapping or clicking. I just gave up on the component altogether. |
@rabidkitten This could happen if they keyboard is still open. Try to pass |
Thanks, worked Perfectly |
I tried running your Example.js on both a real device and an android emulator and the autocomplete window does not show up when I enter the letter 'P' in the input field. What I'm expecting is a dropdown that shows the 3 titles as per your animated gif. Is there a known issue with android or any reason why the example isn't working as expected?
I also tried adding a console.log to the 'onShowResult' event and it never outputs to Logcat (which makes me believe something isn't right)
Thanks in advance
The text was updated successfully, but these errors were encountered: