Use in-place source move for drag instead of placeholder + display:none
The clone-placeholder approach hid the source element with display:none, which some browsers treat as drag cancellation. The drag appeared to "not respond at all" to mouse press. Switch to a simpler approach: keep the source element in the DOM and move it directly during dragover. Apply a .dragGhost class after the drag image is captured (via setTimeout 0) so the source becomes a translucent dashed placeholder at the prospective drop position. drop just compares the source's current DOM index to its original data-index. Also add cursor:grabbing on :active for visible press feedback. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -440,16 +440,16 @@ body.siteBody.centerLayout {
|
||||
}
|
||||
.rowDur { color: var(--text-muted); font-size: 13px; }
|
||||
|
||||
/* 드래그 시스템 공통: 원본은 잠시 숨기고, 같은 모양의 placeholder 가 들어갈 자리에서 반투명하게 보임 */
|
||||
.hiddenWhileDragging { display: none !important; }
|
||||
.dragPlaceholder {
|
||||
/* 드래그 시스템: 원본 요소가 그대로 새 위치로 이동하면서 반투명 ghost 로 보임 */
|
||||
.dragGhost {
|
||||
opacity: 0.45;
|
||||
pointer-events: none;
|
||||
outline: 2px dashed var(--accent);
|
||||
outline-offset: -2px;
|
||||
background: rgba(47, 129, 247, 0.08);
|
||||
}
|
||||
.dragPlaceholder * { pointer-events: none !important; }
|
||||
.dragGhost * { pointer-events: none !important; }
|
||||
.trackRow:active { cursor: grabbing; }
|
||||
.imageCard:active { cursor: grabbing; }
|
||||
|
||||
/* 사진 그리드 */
|
||||
.imageGrid {
|
||||
|
||||
Reference in New Issue
Block a user