mckenziearts / laravel-notify

Flexible Flash notifications for Laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not auto-close

kgp43 opened this issue · comments

commented

Hi,

I'm not sure what is causing this.
I'm using Laravel 8, fresh install.

Got this in my template:

<head>
....
@notifyCss
</head>
<body>
@include('notify::messages')
@notifyJs
</body>
  • The notification appear as it should.
  • Does not auto-close.

Also tried to change the location to the bottom-right, but it still show in upper right corner:

'position' => 'bottom-right',

Not sure what is causing this.

Also not auto closing for me. Using Laravel 7.

Would be nice to set a timeout for how long it should stay and then auto close.

not worked here also

Same here, investigating...

"laravel/framework": "^8.12" fired twice and does't auto close

commented

"laravel/framework": "^8.12" fired twice and does't auto close

Same here

commented

Project not updated in 6 months and others reporting the same issue.
Guess we need to look for something else.

Add the following line of code before your close body tag:

<script type="text/javascript">
$(document).ready(function() {
    $(".inset-0").delay(2500).fadeOut(300);
});
</script>

Add the following line of code before your close body tag:

<script type="text/javascript">
$(document).ready(function() {
    $(".inset-0").delay(2500).fadeOut(300);
});
</script>

Does not work for me

I still couldn't get this to work. I am using Laravel 9 and the notification just stays there no matter the timeout value I set. @RathaGit fix worked for me thankfully but perhaps if there is a specific way this should be done within the package the documentation should get updated to show this?

I had the same problem. 

Using Laravel 9, tailwind 3, Livewire 2, alpine 3.

I removed @notifyjs and replaced with this. All it seems to do is load Alpine which was already being loaded by Livewire.

<script type="text/javascript">
        e = document.querySelector("div.notify");
        if(e) {
           setTimeout(function(){ e.style.display = 'none'}, 5000);
        }
</script>