fix: adjust drag handle vertical positioning for smaller size

- Update line height calculation from 24px to 20px handle height
- Remove extra 4px offset that was compensating for old size
- Handle now properly aligns with text baseline

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-06-26 10:21:35 -04:00
parent 5e9df976e3
commit 8f884af5d7

View file

@ -324,7 +324,7 @@ export function DragHandlePlugin(options: GlobalDragHandleOptions & { pluginKey:
const lineHeight = isNaN(parsedLineHeight)
? parseInt(compStyle.fontSize) * 1.2
: parsedLineHeight
rect.top += (lineHeight - 24) / 2
rect.top += (lineHeight - 20) / 2
rect.top += paddingTop
}
// Li markers
@ -341,7 +341,7 @@ export function DragHandlePlugin(options: GlobalDragHandleOptions & { pluginKey:
// Add 12px gap between drag handle and content
// Position the handle inside the padding area, close to the text
dragHandleElement.style.left = `${rect.left + paddingLeft - rect.width - 12}px`
dragHandleElement.style.top = `${rect.top - 4}px` // Offset for padding
dragHandleElement.style.top = `${rect.top}px`
showDragHandle()
},
keydown: () => {