From 9a8d545f0992e4c8c75109accc966c9e6ba198c4 Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Wed, 18 Dec 2024 11:54:42 +0100 Subject: [PATCH] fix(esl-toggleable): ESLToggleable should ignore activator direct events --- src/modules/esl-toggleable/core/esl-toggleable.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/esl-toggleable/core/esl-toggleable.ts b/src/modules/esl-toggleable/core/esl-toggleable.ts index d0414f873..c2bbe8003 100644 --- a/src/modules/esl-toggleable/core/esl-toggleable.ts +++ b/src/modules/esl-toggleable/core/esl-toggleable.ts @@ -349,6 +349,9 @@ export class ESLToggleable extends ESLBaseElement { // target is inside chain of toggleables if (this.manager && this.manager.isRelates(target, this)) return false; + // ignore event on the activator + if (this.activator && !(e instanceof FocusEvent) && this.activator.contains(target)) return false; + // Event is not a system command key return !(e instanceof KeyboardEvent && SYSTEM_KEYS.includes(e.key)); }