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

Alert component with dismiss button throws error #1815

Closed
JoshSchroder-tdlr opened this issue Jul 20, 2023 · 1 comment · Fixed by #1822
Closed

Alert component with dismiss button throws error #1815

JoshSchroder-tdlr opened this issue Jul 20, 2023 · 1 comment · Fixed by #1822
Assignees
Labels
Milestone

Comments

@JoshSchroder-tdlr
Copy link

Describe the bug
When there is more than one dismissable alert component on a single page, dismissing any alert component results in an uncaught TypeError in the console.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Tailwind Elements project as described in the docs
  2. Add more than one dismissable alert to a single HTML page using the example from the docs
  3. Load the page and open devtools console
  4. Close any of the dismissable alerts
  5. An uncaught type error message appears in the console.

Expected behavior
Multiple dismissable alerts on the same HTML page should not produce unhandled exceptions when one is closed.

Actual behavior
Error code is as follows:
alert.js:231 Uncaught TypeError: Cannot read properties of null (reading 'remove') at Rn._destroyElement (alert.js:231:6) at alert.js:127:1 at he (index.js:337:61) at HTMLDivElement.r (event-handler.js:22:23) at Ea (index.js:176:5) at event-handler.js:26:3
`

Show your code
It will be easier for us to help you if you create a snippet using TE playground and include a link to it in your issue.

The system will not let me save snippets with an account that is < 7 days old, but I did test using this system with a very similar result.

I took the dismissable example from the docs (https://tailwind-elements.com/docs/standard/components/alerts/#dismissing) and added it twice to the snippet. When you close both, you will see errors in the console.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Edge
  • Version 114.0.1823.82
@juujisai juujisai added this to the v1.0.0-beta3 milestone Jul 21, 2023
@juujisai
Copy link
Contributor

Hi! Thanks for reporting this. I have added this issue to our project list.

@juujisai juujisai added the bug label Jul 21, 2023
@juujisai juujisai self-assigned this Jul 21, 2023
@juujisai juujisai linked a pull request Jul 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants