question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`topoffset` does not respect Safe Area on iOS (default value no longer appropriate for Dynamic Island, aka iPhone 14 Pro)

See original GitHub issue

Describe the bug The default value for topOffset is 40, when really it should respect and read from the Safe Area. For reference, the notch on iPhone 13 and earlier was 47pt high, but the SafeArea on the new iPhone 14 Pro with Dynamic Island is 59pt high.

I can’t find any part of the library’s code that takes Safe Area into consideration, but maybe I’m missing it. No matter the implementation: Toasts now show under or bordering on the physical elements on the iPhone 14 Pro, and may intrude on the Safe Area of other devices by default.

Steps to reproduce Steps to reproduce the behavior:

  1. Show a Toast with custom layout/type on an iPhone 14 Pro (only tested on physical device w/ custom layout, but presumably same for simulator and same without any custom layout/type specified).

Expected behavior Toast message avoids the physical aspects of the phone and displays below the Safe Area. (I tend to use some minimum offset when safeArea.bottom == 0.)

Screenshots Difficult to screenshot because the Dynamic Island/notch are not included in device screenshots.

Code sample Any should work. Please let me know if you cannot repro easily/reliably on an iPhone 14 Pro simulator/device and I can take the time to create one.

Environment (please complete the following information):

  • OS: iOS
  • react-native-toast-message version: 2.1.5
  • react-native version v0.69.4

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Tucker2015commented, Oct 1, 2022

You can change topOffset default in

/node_modules/react-native-toast-message/lib/src/useToast.js

I have set it at 55.

0reactions
ericledongecommented, Dec 17, 2022

On my side, with an iPhone 14 Pro, the display spot is perfect, but I can’t see the borders (green or red, depending toast type). Any idea?

Read more comments on GitHub >

github_iconTop Results From Across the Web

iPhone 14 pro with dynamic island … | Apple Developer Forums
Facing the same issue. There is this space between the status bar and the safe area in iPhone 14 Pro and Pro max....
Read more >
Issues · calintamas/react-native-toast-message - GitHub
topoffset does not respect Safe Area on iOS (default value no longer appropriate for Dynamic Island, aka iPhone 14 Pro). #409 opened on...
Read more >
iPhone 14 Pro: How to Turn Off Dynamic Island Content
Unfortunately, there's currently no way to outright disable ‌Dynamic Island‌ content, as its behavior is baked into iOS 16. However, if you're ...
Read more >
Untitled
Good photo editing websites like picnik, Bad gestalten ikea, Not liking you ... Can ipad connect to tv via usb, Art 104 uiuc,...
Read more >
McAnlis Lubbers et al.
doesn't catch you unawares, and make sure they have sane default values. ... Yet, there isn't a good way to modify arrays in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found