Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS error when closing toast #1414

Closed
verheyenkoen opened this issue Apr 9, 2024 · 1 comment · Fixed by #1432
Closed

JS error when closing toast #1414

verheyenkoen opened this issue Apr 9, 2024 · 1 comment · Fixed by #1432
Assignees
Labels
bug Something isn't working cypress-test-requested

Comments

@verheyenkoen
Copy link
Contributor

verheyenkoen commented Apr 9, 2024

Bug description

Auto disappearing toasts set a timer (usually 5s) to clean it up automatically. This code throws an error if you had already manually dismissed the toast using the close icon.

Uncaught TypeError: Cannot read properties of null (reading 'removeChild')
    at app.js?id=da854d5812ee2964b8dfea0d4e19f93a:2:145600

Steps to Reproduce

Reproducible with any scenario that uses an auto-closing dismissable toast, eg.:

  1. Open a published publication
  2. Open DevTools
  3. Click the lock or unlock button
  4. Dimiss the toast with the close icon
  5. Wait 5s until the timeout expires
  6. See error on debug console

Automatic testing scenario

  1. Execute toast triggering action
  2. Dismiss the toast
  3. Wait 5000ms
  4. Test will automatically fail if the JS error still occurs

Risk classification

Likelihood

1: Frequent

Consequences

3: Marginal (no problem for end users but tests often fail because of this)

Expected behavior

No JS error

Screenshots

image

System information

Verified in Chrome, Firefox, Safari and Edge

@verheyenkoen
Copy link
Contributor Author

Reported an issue for this in the htmx repo: bigskysoftware/htmx#2497

verheyenkoen added a commit that referenced this issue Apr 19, 2024
nics pushed a commit that referenced this issue Apr 23, 2024
* Added failing test for #1414

* Added another failing test for templ layouts #1414

* Fixed JS error after manually closing flash messages #1414
verheyenkoen added a commit that referenced this issue Apr 23, 2024
@verheyenkoen verheyenkoen linked a pull request Apr 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cypress-test-requested
Projects
None yet
1 participant