react-native-notifier icon indicating copy to clipboard operation
react-native-notifier copied to clipboard

Large alert messages not dismissed correctly

Open mehulmpt opened this issue 4 years ago • 5 comments

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 avatar May 17 '20 14:05 mehulmpt

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 :)

mehulmpt avatar May 17 '20 15:05 mehulmpt

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 avatar May 17 '20 23:05 seniv

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

seniv avatar May 22 '20 23:05 seniv

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

mehulmpt avatar Jun 02 '20 16:06 mehulmpt

After applying safearea notification is not hiding properly.

shrutikamathur30 avatar Aug 26 '22 13:08 shrutikamathur30