masked-view icon indicating copy to clipboard operation
masked-view copied to clipboard

ScrollView is not working inside maskElement

Open warish56 opened this issue 5 years ago • 4 comments

`<MaskedView
        style={styles.container}
       maskElement={
      <View
        style={[
          {
            flex: 1,
            display: 'flex',
            backgroundColor: 'white',
          },
        ]}>
        <ScrollView
          contentContainerStyle={{padding: 10}}
          style={{
            flex: 1,
            width: '100%',
            borderColor: 'red',
            borderWidth: 1,
          }}>
          {this.state.data.map(item => {
            return (
              <Animated.View
                key={item.id}
                style={[
                  styles.box,
                  {
                    // transform: [
                    //   {
                    //     scale: this.state.animations
                    //       ? this.state.animations[item.id].scale
                    //       : 0,
                    //   },
                    // ],
                    opacity: this.state.animations
                      ? this.state.animations[item.id].scale
                      : 0,
                  },
                ]}
              />
            );
          })}
        </ScrollView>

        <Animated.View
          style={[
            styles.floatButton,
            {
              transform: [
                {
                  scale: this.state.scale,
                },
              ],
              opacity: this.state.opacityFade,
              //   backgroundColor: this.state.done ? 'transparent' : 'blue',
            },
          ]}
        />
      </View>
    }>
    <Animated.View
      style={{
        flex: 1,
        opacity: this.state.opacityView,
      }}>
      <Details visible={!this.state.started} onPress={this.animateButton} />
    </Animated.View>
  </MaskedView>`

warish56 avatar Aug 19 '19 11:08 warish56

Were you able to resolve this?

adeshpande3 avatar Oct 02 '19 20:10 adeshpande3

On Thu, 3 Oct 2019 at 2:12 AM, Adit Deshpande [email protected] wrote:

Were you able to resolve this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-masked-view/issues/20?email_source=notifications&email_token=AE4K6ZUONW2YIYDONOC2AO3QMUBTVA5CNFSM4IM7ESP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAGDQYI#issuecomment-537671777, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4K6ZVDJ25C5CF55P5BZQLQMUBTVANCNFSM4IM7ESPQ .

No, not yet.

Xavior

warish56 avatar Oct 02 '19 20:10 warish56

Found a bit of a solution. If you look at the underlying code, you can see that pointerEvents is being set to none which is why touches aren't being propagated. You patch that file to set it to none.

image

If you do that, and set the zIndex of the mask lower than that of the scrollView, then it should work. Hope it helps.

adeshpande3 avatar Oct 19 '19 17:10 adeshpande3

Any fix for this?

Meninblack007 avatar Jan 06 '21 10:01 Meninblack007