ngxpert / hot-toast

🍞 Smoking hot toast notifications for Angular.
https://ngxpert.github.io/hot-toast/
MIT License
73 stars 7 forks source link

Edge case where close button does not work #21

Closed meriem-matouk closed 1 month ago

meriem-matouk commented 1 month ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

I have this simple repro code, just run it and show the 2 toasts, then attempt to close them, the first will close while the second toast won't close.

import { ChangeDetectionStrategy, Component, TemplateRef } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import 'zone.js';
import { HotToastService, provideHotToastConfig } from '@ngxpert/hot-toast';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';

@Component({
  selector: 'app-root',
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
  <button (click)="showToast()">
    Show Toast with Material Symbol Icon
  </button>
  `,
})
export class App {
  name = 'Angular';
  constructor(private toast: HotToastService) {}

  showToast() {
    this.toast.error('eroor.....');
  }
}

bootstrapApplication(App, {
  providers: [
    provideHotToastConfig({
      position: 'top-right',
      stacking: 'vertical',
      visibleToasts: 5,
      autoClose: true,
      dismissible: true,
      style: {
        padding: '16px',
      },
    }), // @ngxpert/hot-toast providers
    provideAnimationsAsync(),
  ],
});

Expected behavior

The toast should close when i click on the close button

Minimal reproduction of the problem with instructions

Here is a stackblitz repro for the issue: https://stackblitz.com/edit/stackblitz-starters-41c25s?file=src%2Fmain.ts

What is the motivation / use case for changing the behavior?

improve user experience

Environment

/


Angular version: 18.0.0


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: 20  
- Platform:  Windows 

Others:

rajanchavda commented 1 month ago

@meriem-matouk Can you please try with v3.0.1 !!!

meriem-matouk commented 1 month ago

@meriem-matouk Can you please try with v3.0.1 !!!

the same issue with v3.0.1

shhdharmen commented 1 month ago

I checked your stackblitz, and it's working as expected in Mac/Edge. Are you using linux?

https://github.com/user-attachments/assets/33478b1b-d36d-49a9-8086-160ba10f089d

meriem-matouk commented 1 month ago

@shhdharmen I'm using chrome on windows

https://github.com/user-attachments/assets/0adb024d-cbac-475b-aa14-bb79ffc63193

rajanchavda commented 1 month ago

Yes, there is still some issue on windows. I am also facing the same.

Ev357 commented 1 month ago

https://ngxpert.github.io/hot-toast/

My reproduction:

  1. Open the Dismissible toast
  2. Quickly open the Events toast
  3. Close the Events toast
  4. I cannot close the Dismissible toast anymore

Screencast_from_5.4.2024_12_36_56.webm

shhdharmen commented 1 month ago

:tada: This issue has been resolved in version 3.0.2-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 3.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: