Skip to content

Commit

Permalink
fix: hide event registration leak (#6521)
Browse files Browse the repository at this point in the history
* fix hide event registration leak

* fix typing error

---------

Co-authored-by: Nikolai Orekhov <no@3cx.com>
Co-authored-by: SvetlanaMuravlova <83700465+SvetlanaMuravlova@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 8, 2023
1 parent 5f1af42 commit 795b378
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ export function listenToTriggersV2(renderer: Renderer2,
const showFn = useToggle ? options.toggle : options.show;

if (!useToggle && trigger.close && options.hide) {
const _hide = renderer.listen(target, trigger.close, options.hide);
_registerHide.push(() => _hide);
const triggerClose = trigger.close;
const optionsHide = options.hide;
const _hide = () => renderer.listen(target, triggerClose, optionsHide);
_registerHide.push(_hide);
}

if (showFn) {
Expand Down

0 comments on commit 795b378

Please sign in to comment.