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

[Modal] Using modal.dispose does not remove listener on "EVENT_KEYDOWN_DISMISS" from document #1978

Closed
hallelujah opened this issue Oct 1, 2023 · 1 comment · Fixed by #2106
Assignees
Milestone

Comments

@hallelujah
Copy link

Describe the bug

Using modal.dispose() does not clear up the listener on EVENT_KEYDOWN_DISMISS from document
That leads to javascript errors

To Reproduce
Steps to reproduce the behavior:

Follow the instructions in the linked repository

Expected behavior

Using dispose() should clear everything created by the Modal component.

Actual behavior

document is polluted with a listener that cannot fulfill anymore its role

Show your code

Created an application instead of using tailwind-elements playground
Here is the repository: https://github.com/hallelujah/tw-elements-modal-bug

Desktop (please complete the following information):

  • OS: Mac OS X Ventura 13.5.2 (22G91)
  • Browser Chrome / Safari / Firefox
  • Version 117.0.5938.92 / Version 16.6 (18615.3.12.11.2) / Version 16.6 (18615.3.12.11.2)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Make sure it is indeed an issue/bug report

@juujisai
Copy link
Contributor

juujisai commented Oct 2, 2023

Hi! Thanks for reporting this bug. I'm adding this to our list

@juujisai juujisai added this to the v1.1.0 milestone Oct 2, 2023
@Trochonovitz Trochonovitz linked a pull request Nov 9, 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
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants