Skip to content

Commit e0128e5

Browse files
committed
fix: revert change to ghost element positioning
1 parent ec178a4 commit e0128e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

projects/angular-draggable-droppable/src/lib/draggable.directive.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ describe('draggable directive', () => {
694694
triggerDomEvent('mousedown', draggableElement, { clientX: 5, clientY: 10 });
695695
triggerDomEvent('mousemove', draggableElement, { clientX: 7, clientY: 10 });
696696
const ghostElement = draggableElement.nextSibling as HTMLElement;
697-
expect(ghostElement.style.position).to.equal('absolute');
697+
expect(ghostElement.style.position).to.equal('fixed');
698698
expect(ghostElement.style.top).to.be.ok;
699699
expect(ghostElement.style.left).to.be.ok;
700700
expect(ghostElement.style.width).to.be.ok;
@@ -755,7 +755,7 @@ describe('draggable directive', () => {
755755
triggerDomEvent('mousemove', draggableElement, { clientX: 7, clientY: 10 });
756756
const ghostElement = fixture.componentInstance.ghostElementAppendTo
757757
.children[0] as HTMLElement;
758-
expect(ghostElement.style.position).to.equal('absolute');
758+
expect(ghostElement.style.position).to.equal('fixed');
759759
expect(ghostElement.style.top).to.be.ok;
760760
expect(ghostElement.style.left).to.be.ok;
761761
expect(ghostElement.style.width).to.be.ok;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ export class DraggableDirective implements OnInit, OnChanges, OnDestroy {
419419
document.body.style.cursor = this.dragCursor;
420420

421421
this.setElementStyles(clone, {
422-
position: 'absolute',
422+
position: 'fixed',
423423
top: `${rect.top}px`,
424424
left: `${rect.left}px`,
425425
width: `${rect.width}px`,

0 commit comments

Comments
 (0)