feat: v4.7.0 - resize handle cursor col-resize (explicit div, z-index), grabbing cursor during drag
Some checks failed
Build & Push Docker / build (push) Has been cancelled
Some checks failed
Build & Push Docker / build (push) Has been cancelled
This commit is contained in:
@@ -260,17 +260,20 @@ const Canvas = {
|
||||
(block.responsible ? ` · ${block.responsible}` : '');
|
||||
el.appendChild(inner);
|
||||
|
||||
// Resize handle — explicit element so cursor is always correct
|
||||
const resizeHandle = document.createElement('div');
|
||||
resizeHandle.className = 'block-resize-handle';
|
||||
el.appendChild(resizeHandle);
|
||||
|
||||
// Click to edit
|
||||
el.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
App.openBlockModal(block.id);
|
||||
});
|
||||
|
||||
// Native pointer drag — ghost on document.body, avoids overflow/clipping issues
|
||||
// Native pointer drag — skip if clicking the resize handle (interact.js owns that)
|
||||
el.addEventListener('pointerdown', (e) => {
|
||||
const elRect = el.getBoundingClientRect();
|
||||
if (e.clientX > elRect.right - 8) return; // right 8px = resize handle
|
||||
e.preventDefault();
|
||||
if (e.target.closest('.block-resize-handle')) return;
|
||||
e.stopPropagation();
|
||||
this._startPointerDrag(e, el, block);
|
||||
});
|
||||
@@ -320,8 +323,9 @@ const Canvas = {
|
||||
// Release implicit pointer capture so pointermove fires freely on document
|
||||
try { el.releasePointerCapture(e.pointerId); } catch (_) {}
|
||||
|
||||
// Prevent text selection during drag
|
||||
// Prevent text selection + set grabbing cursor during drag
|
||||
document.body.style.userSelect = 'none';
|
||||
document.body.style.cursor = 'grabbing';
|
||||
|
||||
// ── Ghost element ─────────────────────────────────────────────
|
||||
const ghost = document.createElement('div');
|
||||
@@ -379,6 +383,7 @@ const Canvas = {
|
||||
el.style.opacity = '';
|
||||
clearHighlights();
|
||||
document.body.style.userSelect = '';
|
||||
document.body.style.cursor = '';
|
||||
|
||||
const dx = ev.clientX - startX;
|
||||
const dy = ev.clientY - startY;
|
||||
|
||||
Reference in New Issue
Block a user