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

Not all TinyMCE events are being removed after tinymce.remove() call #9377

Open
ganigeorgiev opened this issue Feb 10, 2024 · 0 comments
Open

Comments

@ganigeorgiev
Copy link

ganigeorgiev commented Feb 10, 2024

📝 Provide detailed reproduction steps (if any)

I'm not sure if I'm interpreting it wrong or it is some sort of a leak, but after calling window.tinymce.remove() there are still TinyMCE drag and mouse events attached to the document element.

Based on fiddle.tiny.cloud, this seems to have been introduced with TinyMCE 6.2.0+.
It works as expected and there are no remaining TinyMCE events in TinyMCE 6.1.2.

I noticed it during profiling as it triggers unnecessary "Recalculate style" logs in our case.

To reproduce it:

  1. Go to https://fiddle.tiny.cloud/ and test with TinyMCE 6.2+
  2. Open the browser's Inspect tool (Chrome in my case)
  3. Go to "Console" tab, select the previewiframe as executing context and run tinymce.remove().
  4. Go to "Elements" tab and select the previewiframe #document element.
  5. Switch to "Events listeners" and notice the remaining events.

You should see something like:

inspect_tool_screenshot.

✔️ Expected result

I expect all TinyMCE related event listeners to be removed after calling tinymce.remove().

❌ Actual result

After calling tinymce.remove() there are still events attached to the document element.

📃 Other details

  • Browser: Chrome 121.0.6167.139 (Official Build) (64-bit)
  • OS: Linux (Fedora 39)
  • First affected version: TinyMCE 6.2.0
  • Worked in version: TinyMCE 6.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant