Skip to content

TouchableNativeFeedback and flexDirection 'row' #5938

@fabianmuecke

Description

@fabianmuecke

I have a view where I try to render a bar of 3 buttons at the top of the screen like this (simplified example):

<View style={{flex: 1, flexDirection: 'row'}}>
  <TouchableNativeFeedback key="nf1" background={TouchableNativeFeedback.SelectableBackground()}>
    <View style={{height: 100, width: 100}}><Text>Test</Text></View>
  </TouchableNativeFeedback>
  <TouchableNativeFeedback key="nf2" background={TouchableNativeFeedback.SelectableBackground()}>
    <View style={{height: 100, width: 100}}><Text>Test</Text></View>
  </TouchableNativeFeedback>
  <TouchableNativeFeedback key="nf3" background={TouchableNativeFeedback.SelectableBackground()}>
    <View style={{height: 100, width: 100}}><Text>Test</Text></View>
  </TouchableNativeFeedback>
</View>

For the second and third button, the animated effect starts to spread from the right edge and lower half of the button, no matter where the touch occurs. For the first button the effect works as expected (the animation starting to spread from the touch point).

If I remove flexDirection: 'row', the effect works as expected for all buttons (but of course does not render the layout I want).

Edit: flexDirection: 'column' doesn't work properly, too. There the effect starts at the bottom of the second and third element, no matter where the touch occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions