Skip to content

Commit 451f69f

Browse files
committed
feat(igxDrag/igxDrop): Replace dragGhost directive with input. Code restructuring to reflect API. #5319
1 parent aaa117e commit 451f69f

File tree

6 files changed

+264
-139
lines changed

6 files changed

+264
-139
lines changed

projects/igniteui-angular/src/lib/directives/dragdrop/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Usage
55
```html
6-
<div igxDrag [hideBaseOnDrag]="true" [animateOnRelease]="true" *ngFor="let elem of draggableElems" >
6+
<div igxDrag [animateOnRelease]="true" *ngFor="let elem of draggableElems" >
77
<span [style.margin]="'auto'">{{elem.label}}</span>
88
</div>
99
```
@@ -26,11 +26,9 @@ The `igxDrag` directive can be applied on any DOM element by just adding it to i
2626

2727
By default a drag operation starts when the end user swipes at least 5 px in any direction. Otherwise the interaction is considered as a click and the `dragClicked` event is emitted.
2828

29-
When dragging occurs a drag ghost element is spawned and moves along with the mouse cursor or touch interaction. The original element is still present, but it can be hidden automatically when dragging starts with the `hideBaseOnDrag` input.
29+
When dragging occurs a drag ghost element is spawned and moves along with the mouse cursor or touch interaction.The dragging can be canceled by setting the `cancel` property of the `dragStart` event to `true`. This will cancel the default dragging logic.
3030

31-
The dragging can be canceled by setting the `cancel` property of the `dragStart` event to `true`. This will cancel the default dragging logic.
32-
33-
After the user releases the mouse/touch the drag ghost element is removed from the DOM and if the `hideBaseOnDrag` is enabled it will make the original element visible again and the `dragEnd` event will be emitted. If the `animateOnRelease` input is set to `true` all this will execute after the default animation of the drag ghost is finished which consist of returning it from the last dragged position to the position of the original element. Then the drag ghost will be removed and the `returnMoveEnd` event will be emitted.
31+
After the user releases the mouse/touch the drag ghost element is removed from the DOM and the `dragEnd` event will be emitted. If the `animateOnRelease` input is set to `true` all this will execute after the default animation of the drag ghost is finished which consist of returning it from the last dragged position to the position of the original element. Then the drag ghost will be removed and the `returnMoveEnd` event will be emitted.
3432

3533
## API
3634

@@ -40,10 +38,9 @@ After the user releases the mouse/touch the drag ghost element is removed from t
4038
| :--- | :--- | :--- | :--- |
4139
| igxDrag | any | - | Input used to save data inside the `igxDrag` directive. This can be set when instancing `igxDrag` on an element. |
4240
| dragTolerance | number | 5 | Indicates when the drag should start (in pixels). By default the drag starts after the draggable element is moved by 5px |
41+
| dragGhostHost | any | null | Sets the element to which the dragged element will be appended.
4342
| ghostImageClass | string | '' | Sets a custom class that will be added to the `dragGhost` element. |
44-
| hideBaseOnDrag | boolean | false | Sets if the draggable element should hide when dragging starts. |
4543
| animateOnRelease | boolean | false | Enables/disables the draggable element animation when the element is released. |
46-
| dragGhostHost | any | null | Sets the element to which the dragged element will be appended.
4744

4845
### Outputs
4946

projects/igniteui-angular/src/lib/directives/dragdrop/drag-ghost.directive.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)