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

Toast Message off screen in long lists #72

Open
RajivPilgaonkar opened this issue Apr 8, 2019 · 4 comments
Open

Toast Message off screen in long lists #72

RajivPilgaonkar opened this issue Apr 8, 2019 · 4 comments

Comments

@RajivPilgaonkar
Copy link

Hi, I'm trying to use easy-toast and it works very well. But there is one instance I have of a long flatlist. If the list is rather long, I realized that the toast message appears but it is off the screen and you have to scroll in order to see it. Not sure if I am doing something wrong. Here is the code. I have used this on an Android device.

renderHeaderList() {
return (

  <View style={{ flex: 1 }}>

    <ScrollView
      ref={(c) => { this.scroll = c; }}
    >

      <FlatList
        ref={(ref) => { this.flatListRef = ref; }}
        data={{ g_data }}
        renderItem={this.renderItem}
        keyExtractor={(item) => item.srNo}
      />

  </ScrollView>

  <Toast
    ref="toast"
    position={'top'}
    style={{ backgroundColor: 'red' }}
  />

  </View>
);

}

@anujraghuvanshi
Copy link

Getting the same issue. Any updates here ?
@RajivPilgaonkar were you able to overcome this anyway ?

@RajivPilgaonkar
Copy link
Author

RajivPilgaonkar commented Jan 20, 2023 via email

@Tchaikovsky1114
Copy link

i got same issue in long list

what can i do ?

@shayan1234554321
Copy link

I have a solution (it's 2023, so 4 years later 😂 )

  • Try position : fixed; like this
<Toast
    ref="toast"
    position={'top'}
    style={{ backgroundColor: 'red', position: fixed }}
  />
  • If didnt worked, try writing it in another View component and give position fixed to it
<View style={{position: fixed}}>
  <Toast
    ref="toast"
    position={'top'}
    style={{ backgroundColor: 'red' }}
  />
</View>
  • Still not working, then try calculating scroll position using JS, and give offset that value
    I dont have a code snippet for that as i dont know how to calculate scroll position 😅

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

4 participants