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 with placement "Top" does not take the StatusBar height #125

Open
yepMad opened this issue Mar 20, 2022 · 2 comments
Open

Toast with placement "Top" does not take the StatusBar height #125

yepMad opened this issue Mar 20, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@yepMad
Copy link

yepMad commented Mar 20, 2022

Current behaviour

If the StatusBar has a background color, the Toast with placement "Top" is partially hidden by the StatusBar

Expected behaviour

Toast calculate the margin with reference to the StatusBar size

Code sample

toast.show(message, {
      type: 'danger',
      placement: 'top',
      duration: 4000,
      animationType: 'slide-in',
});

Screenshots (if applicable)

image

What have you tried

toast.show(message, {
      type: 'danger',
      placement: 'top',
      duration: 4000,
      style: { marginTop: StatusBar.currentHeight }, // <- This solve the problem!
      animationType: 'slide-in',
});

Your Environment

software version
ios or android 9
react-native 0.64.3
react-native-toast-notifications 3.2.3
node 16.13.0
npm or yarn Yarn 1.23.0-20210726.1745
@yepMad yepMad added the bug Something isn't working label Mar 20, 2022
@yepMad
Copy link
Author

yepMad commented Mar 20, 2022

FYI: Right now my time is very busy, in case no one has time to take a look at this until I'm free, when I do I'll make it a priority.

@yepMad
Copy link
Author

yepMad commented Mar 20, 2022

The problem with the solution I presented on "What have you tried" is that all the following items in the queue will come with a marginTop the size of the StatusBar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant