Skip to content

[TouchableHighlight] activeOpacity not working #11834

@Kerumen

Description

@Kerumen

Description

The activeOpacity of the TouchableHighlight component is not working. By default it's 0.85 hence the black underlayColor should not be full black.
And even if I add the prop activeOpacity and set it to a custom value, nothing change, the underlay color is still full black.

jan-11-2017 13-23-40

Reproduction

<TouchableHighlight onPress={() => {}} underlayColor={/* whatever */}>
  <Text>PRESS ME</Text>
</TouchableHighlight>

Solution

A weird thing I noticed: if I use a custom component in the TouchableHighlight with a View for its root and I forward the native props with setNativeProps to this View, the activeOpacity works fine. It doesn't work if I directly use a View in the TouchableHighlight children.

Additional Information

  • React Native version: 0.41.0-rc.0
  • Platform: iOS
  • Operating System: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions