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

TriggeringView doesn't trigger callback function while scrolling #92

Open
yungts97 opened this issue Dec 15, 2020 · 18 comments
Open

TriggeringView doesn't trigger callback function while scrolling #92

yungts97 opened this issue Dec 15, 2020 · 18 comments

Comments

@yungts97
Copy link

yungts97 commented Dec 15, 2020

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
Copy link

+1

1 similar comment
@nazacity
Copy link

+1

@swrzalek
Copy link

swrzalek commented Dec 25, 2020

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]}>
                <View style={styles.contentHeader}>
                    <Text style={styles.title}>{this.props.menu.premises.name}</Text>
                    <TouchableOpacity>
                        <Text style={styles.description}>
                                Here should be description...
                        </Text>
                    </TouchableOpacity>
                </View>
                {this.renderMenuItems()}
            </View>
                </TriggeringView>
              </View>
            </ImageHeaderScrollView>
         </View>

`

@jiabinxiong
Copy link

jiabinxiong commented Dec 27, 2020

+1

back 0.10.3

@techtg
Copy link

techtg commented Dec 28, 2020

+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
Copy link

Joao208 commented Jan 3, 2021

  • 1

@mir1198yusuf
Copy link

This is the correct answer
#92 (comment)

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

@mir1198yusuf
Copy link

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

@nazacity
Copy link

nazacity commented Feb 6, 2021

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
Copy link

@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
Copy link

ktt9117 commented May 27, 2021

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

@mir1198yusuf
Copy link

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

@sootood
Copy link

sootood commented Jun 5, 2021

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

@mir1198yusuf
Copy link

please see solution above instead of waiting for new PR

@roots-ai
Copy link

Any updates here?
@mir1198yusuf Downgrade to what version?

@mir1198yusuf
Copy link

@roots-ai see this comment & also the one below it #92 (comment)

@roots-ai
Copy link

roots-ai commented Sep 27, 2022

@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
Copy link

wspirin commented Jul 4, 2023

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

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