Skip to content

Commit 6b6fcb2

Browse files
author
Xie, Ziyu
committed
Bugfix: handle event target
1 parent ee14a8b commit 6b6fcb2

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Angular directive (for version >= 4.x ) that makes the DOM element draggable.
1919
angular2-draggable is an angular (ver >= 4.x) directive that makes the DOM element draggable. (Note that: It's different from drag-and-drop)
2020

2121
# Latest Update
22+
+ 2018.05.11: 1.4.1
23+
+ Bugfix: Handle Drag is not working in Firefox [#68](https://github.com/xieziyu/angular2-draggable/issues/68).
24+
2225
+ 2018.05.04: 1.4.0
2326
+ Provide `[gridSize]` option for snapping to grid. Refer to [demo](https://xieziyu.github.io/angular2-draggable/#/advance/snap-grid). (PR [#64](https://github.com/xieziyu/angular2-draggable/pull/64) by [PAHADIx](https://github.com/PAHADIx))
2427
+ Code optimized. (PR [#60](https://github.com/xieziyu/angular2-draggable/pull/60) by [korn3l](https://github.com/korn3l))

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular2-draggable",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "Angular directive that makes the DOM element draggable",
55
"repository": "https://github.com/xieziyu/angular2-draggable.git",
66
"author": "Xie, Ziyu <ziyu.xie@foxmail.com>",

lib/src/directive/angular-draggable.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export class AngularDraggableDirective implements OnInit, OnChanges {
305305
}
306306
}
307307

308-
checkHandleTarget(target: Element, element: Element) {
308+
checkHandleTarget(target: EventTarget, element: Element) {
309309
// Checks if the target is the element clicked, then checks each child element of element as well
310310
// Ignores button clicks
311311

@@ -341,7 +341,8 @@ export class AngularDraggableDirective implements OnInit, OnChanges {
341341
return;
342342
}
343343
// 2. if handle is set, the element can only be moved by handle
344-
if (this.handle !== undefined && !this.checkHandleTarget(event.srcElement, this.handle)) {
344+
let target = event.target || event.srcElement;
345+
if (this.handle !== undefined && !this.checkHandleTarget(target, this.handle)) {
345346
return;
346347
}
347348

src/assets/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.4.1 (2018-05-11)
2+
3+
#### Bugfix
4+
+ Handle Drag is not working in Firefox [#68](https://github.com/xieziyu/angular2-draggable/issues/68).
5+
6+
---
7+
18
## 1.4.0 (2018-05-04)
29

310
#### New

0 commit comments

Comments
 (0)