bamlab / react-native-image-header-scroll-view

ScrollView with an image in header which becomes a navbar
MIT License
990 stars 94 forks source link

TriggeringView doesn't trigger callback function while scrolling #92

Open yungts97 opened 3 years ago

yungts97 commented 3 years ago

I tried to implement it on Android. But it doesn't trigger the callback function. Here is the code:

<View>
     <TriggeringView
            onHide={() => alert("hide")}
            onDisplay={() => alert("show")}>
               <Text>Hello World</Text>
      </TriggeringView>
</View>
RomanKwok commented 3 years ago

+1

nazacity commented 3 years ago

+1

swrzalek commented 3 years ago

I've got same issue.

Listener on ScrollY is not triggering onScolll function.

` <View style={{flex: 1}}> <ImageHeaderScrollView maxHeight={250} minHeight={0} headerImage={this.props.menu ? {uri: this.props.menu.premises.image_url} : {}}

<View style={{ height: 1000}}> <TriggeringView onHide={() => console.log("Hide")} onDisplay={() => console.log("Show")} onLayout={() => console.log("change")}

<View style={[styles.flex, styles.content]}>

{this.props.menu.premises.name} Here should be description...

{this.renderMenuItems()} `

jiabinxiong commented 3 years ago

+1

back 0.10.3

techtg commented 3 years ago

+1 Here is package.json: "dependencies": { "@expo/vector-icons": "^12.0.1", "@react-native-community/blur": "^3.6.0", "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.11.2", "@react-navigation/drawer": "^5.11.4", "@react-navigation/native": "^5.8.10", "@react-navigation/stack": "^5.12.8", "expo-status-bar": "^1.0.2", "react": "16.13.1", "react-dom": "^17.0.1", "react-native": "0.63.4", "react-native-animatable": "^1.3.3", "react-native-dropdownalert": "^4.3.0", "react-native-elements": "^3.0.1", "react-native-gesture-handler": "^1.9.0", "react-native-image-header": "^1.0.1", "react-native-image-header-scroll-view": "^1.0.0", "react-native-paper": "^4.4.1", "react-native-reanimated": "^1.13.2", "react-native-safe-area-context": "^3.1.9", "react-native-screens": "^2.15.0", "react-native-skeleton-placeholder": "^3.0.2", "react-native-sticky-parallax-header": "^0.4.0", "react-native-vector-icons": "^7.1.0", "react-native-web": "^0.14.9", "react-navigation": "^4.4.3" }

Joao208 commented 3 years ago
mir1198yusuf commented 3 years ago

This is the correct answer https://github.com/bamlab/react-native-image-header-scroll-view/issues/92#issuecomment-751445561

I changed in package.json "react-native-image-header-scroll-view": "^0.10.3"

mir1198yusuf commented 3 years ago

By 0.10.3, imports will be changed as follows : import ImageHeaderScrollView, {TriggeringView } from 'react-native-image-header-scroll-view';

nazacity commented 3 years ago

By 0.10.3, imports will be changed as follows : import ImageHeaderScrollView, {TriggeringView } from 'react-native-image-header-scroll-view';

we need to use new version not old man

mir1198yusuf commented 3 years ago

@nazacity - this issue is happening in new version. I don't think this repo is maintained regularly as I can see 2 years older issue still open.

The scrolling events were not working with new version so I had to downgrade it to older one.

If anyone submits a PR for newer version then it's good

ktt9117 commented 3 years ago

I've got same issue at v1.0.0 is there any update?

mir1198yusuf commented 3 years ago

I don't think it will be fixed soon, better downgrade and continue

sootood commented 3 years ago

i have same issue please fix it because whiteout these options library became useless

mir1198yusuf commented 3 years ago

please see solution above instead of waiting for new PR

roots-ai commented 2 years ago

Any updates here? @mir1198yusuf Downgrade to what version?

mir1198yusuf commented 2 years ago

@roots-ai see this comment & also the one below it https://github.com/bamlab/react-native-image-header-scroll-view/issues/92#issuecomment-774402394

roots-ai commented 2 years ago

@mir1198yusuf Thanks for your reply. Even this version is just calling onBeginHidden and onDisplay, it doesn't call onBeginDisplayed, onHide. But made it work by doing slight editions to TriggeringView.js

wspirin commented 1 year ago

@roots-ai Can you share your upgraded TriggeringView.js ?