mckenziearts / laravel-notify

Flexible Flash notifications for Laravel
Other
1.62k stars 189 forks source link

Does not auto-close #53

Closed kgp43 closed 3 years ago

kgp43 commented 3 years ago

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>

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.

matthbon commented 3 years ago

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.

titusfrezer commented 3 years ago

not worked here also

daniel-farina commented 3 years ago

Same here, investigating...

milantarami commented 3 years ago

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

kgp43 commented 3 years ago

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

Same here

kgp43 commented 3 years ago

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

RathaGit commented 3 years ago

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>
mwamodo commented 3 years ago

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

mckenziearts commented 3 years ago

New release publish. More details here https://github.com/mckenziearts/laravel-notify/releases/tag/v2.2

RobHowdle commented 2 years ago

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?

krismanning commented 1 year ago
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>
dharmik225 commented 11 months ago

image

Does not auto close in livewire3 with "wire.navigate"