Skip to content

Commit

Permalink
Prevent the leak of codex-tooltip when Editor.js is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
hata6502 committed Mar 19, 2021
1 parent 7979390 commit bd1af90
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@
},
"dependencies": {
"codex-notifier": "^1.1.2",
"codex-tooltip": "^1.0.1"
"codex-tooltip": "^1.0.2"
}
}
7 changes: 7 additions & 0 deletions src/components/modules/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bd1af90

Please sign in to comment.