wiris / html-integrations

The official JavaScript library for MathType, the leading formula editor and equation writer for the web by Wiris
https://wiris.com/solutions/integrations/html-editors/
MIT License
76 stars 53 forks source link

feat(demos): Destroy MathType when the editor is destroyed #934

Closed usantos-at-wiris closed 5 months ago

usantos-at-wiris commented 6 months ago

Description

This fix ensures that when the editor is closed all the MathType remainings (Modal, Events, Instances) are removed from the DOM.

The issue is fixed on #KB-44922 The branch #KB-44922-test adds additional tools to test the fix.

Steps to reproduce

Follow the next steps to reproduce.

  1. Open the editor
  2. Open the MathType modal
  3. Destroy an editor without closing the MathType modal and using the destroy method
  4. Using the developer tools check if the MathType modal is still on the DOM
  5. [Expected] The MathType modal should be removed from the DOM
  6. [Optional] Try creating and destroying the editor multiple times to check if the issue is fixed

Causes

The issue is caused because the MathType modal is not being removed from the DOM when the editor is destroyed.


#taskid 44922 #Child of taskid 44564

usantos-at-wiris commented 6 months ago

Please @wiris/squad-mathtype-integrations can I get an additional review on the last commit? about the generic integration https://integrations.wiris.kitchen/KB-44922-test/html/generic/