Skip to content

Commit

Permalink
fix(focus trigger strategy clickout): consider click target (#2885)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg committed Oct 5, 2021
1 parent 4b8a430 commit a5f695a
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -179,7 +179,12 @@ export class NbFocusTriggerStrategy extends NbTriggerStrategyBase {
* Event target of `click` could be different from `activeElement`.
* If during click you return focus to the host, it won't be opened.
*/
filter(() => this.isNotOnHostOrContainer({ target: this.document.activeElement } as unknown as Event)),
filter((event) => {
if (this.isNotOnHostOrContainer(event)) {
return this.isNotOnHostOrContainer({ target: this.document.activeElement } as unknown as Event);
}
return false;
}),
takeUntil(this.destroyed$),
);

Expand Down

0 comments on commit a5f695a

Please sign in to comment.