Skip to content

Commit f7af815

Browse files
AkxeSanderEliasJefiozie
authored
fix: include page blur in end events for drag (#507)
Co-authored-by: Sander Elias <SanderElias@users.noreply.github.com> Co-authored-by: Jeffrey Bosch <Jefiozie@users.noreply.github.com>
1 parent 0abf63c commit f7af815

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

projects/angular-split/src/lib/split/split.component.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ import {
1919
} from '@angular/core'
2020
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
2121
import type { SplitAreaComponent } from '../split-area/split-area.component'
22-
import { Subject, filter, fromEvent, map, pairwise, skipWhile, startWith, switchMap, take, takeUntil, tap } from 'rxjs'
22+
import {
23+
Subject,
24+
filter,
25+
fromEvent,
26+
map,
27+
merge,
28+
pairwise,
29+
skipWhile,
30+
startWith,
31+
switchMap,
32+
take,
33+
takeUntil,
34+
tap,
35+
} from 'rxjs'
2336
import {
2437
ClientPoint,
2538
createClassesString,
@@ -197,7 +210,7 @@ export class SplitComponent {
197210
),
198211
),
199212
take(1),
200-
takeUntil(fromMouseUpEvent(this.document, true)),
213+
takeUntil(merge(fromMouseUpEvent(this.document, true), fromEvent(this.document, 'blur'))),
201214
tap(() => {
202215
this.ngZone.run(() => {
203216
this.dragStart.emit(this.createDragInteractionEvent(mouseDownContext.gutterIndex))

0 commit comments

Comments
 (0)