Skip to content

Commit

Permalink
Merge pull request #2833 from exadel-inc/fix/esl-toggleable-outside-a…
Browse files Browse the repository at this point in the history
…ction

fix(esl-toggleable): ESLToggleable should ignore activator direct events
  • Loading branch information
ala-n authored Dec 18, 2024
2 parents 44261ef + 9a8d545 commit 06a64be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/esl-toggleable/core/esl-toggleable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 06a64be

Please sign in to comment.