score:1

Accepted answer

you can't use document, it's an object on the window. the above answer is incorrect and hasn't taken into account this platform is react native (answer has since been removed).

to handle click events, you you need to wrap everything in a touchablewithoutfeedback.

<touchablewithoutfeedback
  onpress={this.hidesearchbar}
/>

i would add a zindex style to the touchablewithoutfeedback and one in styles.scrollview. make sure the zindex inside of styles.scrollview is more than the one you added to the touchablewithoutfeedback.


Related Query

More Query from same tag