Skip to content

Commit

Permalink
fix(observables): pressedObservable ignore synthetic events
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Oct 13, 2020
1 parent d930e9d commit 28e6a04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/cdk/observables/pressed-observable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Observable} from 'rxjs';
import {mapTo, startWith, switchMapTo, take} from 'rxjs/operators';
import {filter, mapTo, startWith, switchMapTo, take} from 'rxjs/operators';
import {mouseDragFinishFrom} from './mouse-drag-finish-from';
import {typedFromEvent} from './typed-from-event';

Expand All @@ -11,6 +11,7 @@ export function pressedObservable(element: Element): Observable<boolean> {
}

return typedFromEvent(element, 'mousedown').pipe(
filter(({isTrusted}) => isTrusted),
switchMapTo(
mouseDragFinishFrom(ownerDocument).pipe(
mapTo(false),
Expand Down

0 comments on commit 28e6a04

Please sign in to comment.