diff --git a/playbook/app/pb_kits/playbook/pb_draggable/_draggable.scss b/playbook/app/pb_kits/playbook/pb_draggable/_draggable.scss index 098f45f292..dd4c468c32 100644 --- a/playbook/app/pb_kits/playbook/pb_draggable/_draggable.scss +++ b/playbook/app/pb_kits/playbook/pb_draggable/_draggable.scss @@ -8,22 +8,8 @@ .pb_draggable_item:hover { cursor: grab; } - &.active_container { - background-color: rgba(0, 0, 0, 0.05); - } } .pb_draggable_placeholder { - background-color: #e0e0e0; - border: 2px dashed #999; - margin: 4px 0; - border-radius: 4px; -} - -.pb_draggable_item { - &.is_dragging { - opacity: 0.5; - position: relative; - z-index: 1000; - } + background-color: rgba($neutral, $opacity_5); } diff --git a/playbook/app/pb_kits/playbook/pb_draggable/index.js b/playbook/app/pb_kits/playbook/pb_draggable/index.js index c4c1aa6d3d..60c85a5521 100644 --- a/playbook/app/pb_kits/playbook/pb_draggable/index.js +++ b/playbook/app/pb_kits/playbook/pb_draggable/index.js @@ -70,10 +70,8 @@ export default class PbDraggable extends PbEnhancedElement { const targetIndex = items.indexOf(targetItem); if (draggedIndex !== -1 && targetIndex !== -1) { - // Remove existing placeholder this.placeholder.remove(); - // Insert placeholder based on mouse position const rect = targetItem.getBoundingClientRect(); const midpoint = rect.top + rect.height / 2; @@ -97,7 +95,6 @@ export default class PbDraggable extends PbEnhancedElement { if (container) { container.classList.add("active_container"); - // Handle empty container if (!container.querySelector('.pb_draggable_item:not(.is_dragging)')) { container.appendChild(this.placeholder); } @@ -112,7 +109,6 @@ export default class PbDraggable extends PbEnhancedElement { container.classList.remove("active_container"); this.draggedItem.style.opacity = '1'; - // Replace placeholder with dragged item if (this.placeholder.parentNode) { this.placeholder.parentNode.insertBefore(this.draggedItem, this.placeholder); this.placeholder.remove(); @@ -120,7 +116,6 @@ export default class PbDraggable extends PbEnhancedElement { container.appendChild(this.draggedItem); } - // Trigger custom event const customEvent = new CustomEvent('pb-draggable-reorder', { detail: { itemId: this.draggedItemId,