Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickable FlipCard - style not passed to TouchableOpacity #50

Open
YPCrumble opened this issue Oct 10, 2017 · 1 comment
Open

Clickable FlipCard - style not passed to TouchableOpacity #50

YPCrumble opened this issue Oct 10, 2017 · 1 comment

Comments

@YPCrumble
Copy link

YPCrumble commented Oct 10, 2017

Thanks for building this repo!

If I add style to my <FlipCard> element and use the clickable FlipCard, styles like width: '100%' won't be passed to the FlipCard element as expected because TouchableOpacity is wrapping the FlipCard element without any style attribute:

    <TouchableOpacity
      testID={this.props.testID}
      activeOpacity={1}
      onPress={() => { this._toggleCard(); }}
    >
      <Animated.View
        {...this.props}
        style={[
          S.flipCard,
          {
            transform,
            opacity,
          },
          this.props.style
        ]}
      >
        {render_side}
      </Animated.View>
    </TouchableOpacity>

My use case is that I want my FlipCard element to span 100% of a surrounding View that has flex:1 set.

I'd be happy to submit a PR if there's a suitable solution. One option that would work from my perspective is to simply add a touchableFlipCardContainer style prop to the FlipCard element. That adds a little complexity so it would be great to hear if there's a better alternative!

@leadhkr
Copy link

leadhkr commented Jul 17, 2018

@YPCrumble I'm having a similar issue where my FlipCard won't flex to the width of its parent View. Have you found a workaround without editing the flipcard library directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants