1

I encountered the following issue: I have a view with two textboxes and one text button. Ones i enter something in the textbox and click on the text button, i have to click twice so that it actually works. If i replace the Scrollview by a View it works. Is there a fix for it?

var TestScreen = React.createClass({
  render: function() {
    var self = this;
   return (
     <ScrollView>
       <TextInput
      placeholder='test' 
       style = {{
         height: 50, 
          backgroundColor: 'green',
       }} />
      <TextInput
      placeholder='test' 
       style = {{
         height: 50, 
          backgroundColor: 'blue',
       }} />
       <Text onPress={() => alert('click')} style = {{
       backgroundColor: 'orange', 
       }} > Text </Text>
     </ScrollView> 
   );
  }
})
Patrick Klitzke
  • 1,519
  • 2
  • 14
  • 24

1 Answers1

3

Did you try to add keyboardShouldPersistTaps='handled' to the ScrollView props?

<ScrollView keyboardShouldPersistTaps='handled'>  
   ...
</ScrollView> 
Hossein
  • 3,755
  • 2
  • 29
  • 39