From 6ec3bbc54e14a47139c079643ad92ee797d30672 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 26 Jun 2025 10:14:47 -0400 Subject: [PATCH] fix: adjust drag handle position to account for block padding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Calculate element's padding-left to position handle correctly - Position drag handle close to text content, not at container edge - Maintains 8px gap between handle and text for visual clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/components/edra/extensions/drag-handle/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/edra/extensions/drag-handle/index.ts b/src/lib/components/edra/extensions/drag-handle/index.ts index 1e3bf50..aabbb55 100644 --- a/src/lib/components/edra/extensions/drag-handle/index.ts +++ b/src/lib/components/edra/extensions/drag-handle/index.ts @@ -335,8 +335,12 @@ export function DragHandlePlugin(options: GlobalDragHandleOptions & { pluginKey: if (!dragHandleElement) return + // Get the computed padding of the element to position handle correctly + const paddingLeft = parseInt(compStyle.paddingLeft, 10) || 0 + // Add 8px gap between drag handle and content - dragHandleElement.style.left = `${rect.left - rect.width - 8}px` + // Position the handle inside the padding area, close to the text + dragHandleElement.style.left = `${rect.left + paddingLeft - rect.width - 8}px` dragHandleElement.style.top = `${rect.top - 4}px` // Offset for padding showDragHandle() },