diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d7e4ad70b2..34e12f76b0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ ### 2.19.3 - `Fix` — Ignore error raised by Shortcut module +- `Fix` - Prevent the leak of codex-tooltip when Editor.js is destroyed [#1475](https://github.com/codex-team/editor.js/issues/1475). ### 2.19.2 diff --git a/package.json b/package.json index 19aff37931..49077a1057 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,6 @@ }, "dependencies": { "codex-notifier": "^1.1.2", - "codex-tooltip": "^1.0.1" + "codex-tooltip": "^1.0.2" } } diff --git a/src/components/modules/tooltip.ts b/src/components/modules/tooltip.ts index f3ff6711c0..fb900d93ba 100644 --- a/src/components/modules/tooltip.ts +++ b/src/components/modules/tooltip.ts @@ -19,6 +19,13 @@ export default class Tooltip extends Module { */ private lib: CodeXTooltips = new CodeXTooltips(); + /** + * Release the library + */ + public destroy(): void { + this.lib.destroy(); + } + /** * Shows tooltip on element with passed HTML content * diff --git a/yarn.lock b/yarn.lock index 0a5b9f99d8..7414ee6ba7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1834,10 +1834,10 @@ codex-notifier@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/codex-notifier/-/codex-notifier-1.1.2.tgz#a733079185f4c927fa296f1d71eb8753fe080895" -codex-tooltip@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/codex-tooltip/-/codex-tooltip-1.0.1.tgz#f6e4f39d81507f9c455b667f1287746d14ee8056" - integrity sha512-1xLb1NZbxguNtf02xBRhDphq/EXvMMeEbY0ievjQTHqf8UjXsD41evGk9rqcbjpl+JOjNgtwnp1OaU/X/h6fhQ== +codex-tooltip@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/codex-tooltip/-/codex-tooltip-1.0.2.tgz#81a9d3e2937658c6e5312106b47b9f094ff7be63" + integrity sha512-oC+Bu5X/zyhbPydgMSLWKoM/+vkJMqaLWu3Dt/jZgXS3MWK23INwC5DMBrVXZSufAFk0i0SUni38k9rLMyZn/w== collapse-white-space@^1.0.2: version "1.0.6"