Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 707458e

Browse files
authored
Merge pull request swiety85#69 from swiety85/bug-with-drag-enter-of-item-prototype-#64
Bug with drag enter of item prototype swiety85#64
2 parents 0d7d8c1 + d10f7ae commit 707458e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

demo/src/app/gridster/gridster-prototype/gridster-prototype.service.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ export class GridsterPrototypeService {
7171
};
7272
});
7373

74-
const dragExt = Observable.concat(Observable.of({
75-
item: null,
76-
isOver: false,
77-
isDrop: false
78-
}), Observable.merge(over, drop))
74+
const dragExt = Observable.merge(
75+
// dragStartSubject is connected in case when item prototype is placed above gridster
76+
// and drag enter is not fired
77+
this.dragStartSubject.map(() => ({ item: null, isOver: false, isDrop: false })),
78+
over,
79+
drop
80+
)
7981
.scan((prev: any, next: any) => {
82+
8083
return {
8184
item: next.item,
8285
isOver: next.isOver,

src/gridster-prototype/gridster-prototype.service.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ export class GridsterPrototypeService {
7171
};
7272
});
7373

74-
const dragExt = Observable.concat(Observable.of({
75-
item: null,
76-
isOver: false,
77-
isDrop: false
78-
}), Observable.merge(over, drop))
74+
const dragExt = Observable.merge(
75+
// dragStartSubject is connected in case when item prototype is placed above gridster
76+
// and drag enter is not fired
77+
this.dragStartSubject.map(() => ({ item: null, isOver: false, isDrop: false })),
78+
over,
79+
drop
80+
)
7981
.scan((prev: any, next: any) => {
82+
8083
return {
8184
item: next.item,
8285
isOver: next.isOver,

0 commit comments

Comments
 (0)