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:
Omotayo Obafemi 2025-01-08 17:52:40 +00:00 committed by GitHub
commit d15a8c2b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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);
}
/**