fix: adjust drag handle position to account for block padding
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
569a124d02
commit
6ec3bbc54e
1 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue