mirror of
https://github.com/codex-team/editor.js
synced 2026-03-14 22:55:47 +01:00
Added fix for memory leak issue (#2893)
* Added fix for memory leak issue * Documented the fix in docs/CHANGELOG.md * v2.31.0 * Documented the fix in docs/CHANGELOG.md * Documented the fix in docs/CHANGELOG.md * Documented the fix in docs/CHANGELOG.md * Documented the fix in docs/CHANGELOG.md --------- Co-authored-by: Omotayo Obafemi <omotayo@testlio.com> Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
parent
d950a11b8e
commit
d15a8c2b2f
2 changed files with 10 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
|||
- `Improvement` - The current block reference will be updated in read-only mode when blocks are clicked
|
||||
- `Fix` - codex-notifier and codex-tooltip moved from devDependencies to dependencies in package.json to solve type errors
|
||||
- `Fix` - Handle whitespace input in empty placeholder elements to prevent caret from moving unexpectedly to the end of the placeholder
|
||||
- `Fix` - Fix the memory leak issue in `Shortcuts` class
|
||||
- `Fix` - Fix when / overides selected text outside of the editor
|
||||
- `DX` - Tools submodules removed from the repository
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,15 @@ class Shortcuts {
|
|||
|
||||
const shortcuts = this.registeredShortcuts.get(element);
|
||||
|
||||
this.registeredShortcuts.set(element, shortcuts.filter(el => el !== shortcut));
|
||||
const filteredShortcuts = shortcuts.filter(el => el !== shortcut);
|
||||
|
||||
if (filteredShortcuts.length === 0) {
|
||||
this.registeredShortcuts.delete(element);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.registeredShortcuts.set(element, filteredShortcuts);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue