seniv / react-native-notifier

Fast and simple in-app notifications for React Native
MIT License
1.05k stars 60 forks source link

Large alert messages not dismissed correctly #8

Open mehulmpt opened 4 years ago

mehulmpt commented 4 years ago

If the content of the alert messages is too much, the alert doesn't dismiss completely and blocks the screen. This is the final state of alert in one case:

Screenshot 2020-05-17 at 7 42 11 PM

Repro: Create an alert with a long message with alert component and other default settings and try to dismiss it.

mehulmpt commented 4 years ago

I've boiled down the problem to MIN_TRANSLATE_Y hardcoded to be 200. This should be set according to the preset alert height. I'll try to send a PR if I get time to fix it sometime. Thanks for the notification plugin :)

seniv commented 4 years ago

Hello @mehulmpt, thanks for the report!

I thought about setting a bigger value to MIN_TRANSLATE_Y, but this creates a delay before the notification will be shown, and because of that, I decided to leave it at 200 as an optimal value.

As an idea, we can set this.translateY to calculated height of the notification+some margin(100px for example) before the "slide down" animation (in showNotification function), and then animate it to the same value in hideNotification function.

Anyway, I will be happy to see your pull request 🙂

seniv commented 4 years ago

Hey @mehulmpt, I just released a new version which partially fixes the problem. Now the notification should always hide correctly.

But "slide down" animation of big components might be a bit unsmooth. Currently, I'm working on improvements here: component-height-calculation

mehulmpt commented 4 years ago

Hi! Sure, I did not get time to get back to this, super busy month. Thanks for the patch for now :)

shrutikamathur30 commented 2 years ago

After applying safearea notification is not hiding properly.