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

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

Merged
merged 1 commit into from
May 16, 2024

Conversation

usantos-at-wiris
Copy link
Contributor

@usantos-at-wiris usantos-at-wiris commented Apr 4, 2024

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 usantos-at-wiris changed the title Kb 44922 Destroy the Wiriseditor when the Froala editor is destroyed Apr 9, 2024
@usantos-at-wiris usantos-at-wiris changed the title Destroy the Wiriseditor when the Froala editor is destroyed Destroy the Wiriseditor when the editor is destroyed Apr 9, 2024
this.removeListeners();
this.overlay.remove();
this.container.remove();
// Reset propertie to allow open again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Reset propertie to allow open again.
// Reset properties to allow open again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@@ -117,6 +123,8 @@ export class FroalaIntegration extends IntegrationModel {
}
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two unnecessary added lines: 126 & 127

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

Util.removeElementEvents(eventTarget);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Unnecessary added space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

Copy link
Contributor

@carla-at-wiris carla-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@usantos-at-wiris
Copy link
Contributor Author

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/

@usantos-at-wiris usantos-at-wiris requested a review from a team April 22, 2024 10:46
Copy link
Contributor

@carla-at-wiris carla-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

.vscode/settings.json Outdated Show resolved Hide resolved
packages/devkit/src/integrationmodel.js Outdated Show resolved Hide resolved
packages/devkit/src/integrationmodel.js Outdated Show resolved Hide resolved
packages/froala/wiris.src.js Outdated Show resolved Hide resolved
packages/tinymce5/editor_plugin.src.js Outdated Show resolved Hide resolved
packages/tinymce6/editor_plugin.src.js Outdated Show resolved Hide resolved
Copy link
Contributor

@jgonzalez-at-wiris jgonzalez-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@usantos-at-wiris usantos-at-wiris changed the title Destroy the Wiriseditor when the editor is destroyed feat(demos): Destroy MathType when the editor is destroyed Apr 22, 2024
@carla-at-wiris carla-at-wiris merged commit f81fa0b into master May 16, 2024
4 checks passed
@xjiang-at-wiris xjiang-at-wiris deleted the KB-44922 branch May 16, 2024 15:32
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

Successfully merging this pull request may close these issues.

None yet

4 participants