I've built an app (you can see a screenShot of it in the following):
At first, my problem was that when I focused on the search input so the keyboard would appear, but I could only dismiss the keyboard by touching the Flatlist and not the area around the search input. So that I added the following code:
const DismissKeyboard = ({ children }) => ( <TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}> {children} </TouchableWithoutFeedback> ); ....and wrapping the whole XJS content of render () inside of <DismissKeyboard>, in doing so I completely resolved the problem of dismissing the keyboard (I mean after this I can now dismiss the keyboard by touching anywhere of the view of this page), but there after I've got another problem. The current problem can be reproduced by the following steps:
I've just rendered the page, everything looks fine & cool (just the beginning)
I can easily scroll the flatlist smoothly
Since for the first time that we render it's focused on the search input, keyboard is appeared, so in order to see the Flatlist behind it completely, should dismiss the keyboard ...
so I outFocus by touching somewhere else in the page
successfully the keyboard dismisses
but Now I can't scroll the Flatlist smoothly
but if I focus on the search input again I'll be able to scroll the Flatlist with no problem
****Note**** If I dismiss the keyboard by clicking the back button of the mobile I won't face the problem but in real world and considering the user experience the user expect that by outFocusing somewhere ( to dismiss the keyboard) should be able to scroll the Flatlist without any problems.
What I've tried:
wrapping the Flatlist inside
ScrollView==> // no change :/giving the style of {{ flex: 1 }} to Flatlist ==> // no change :/
If you help me in any way, it would be appreciated
