NiclasDev63 / tiptap-extension-global-drag-handle

MIT License
45 stars 6 forks source link

Line height returned 'normal' gets parsed to NaN #12

Closed Daniyaalbeg closed 2 months ago

Daniyaalbeg commented 2 months ago

When the computedStyle line height returns 'normal', it gets parsedInt to NaN causing the rect.top to also be NaN. This causes the drag handle to show at its last position the the correct left spacing but on the wrong line.

Instead proposing to use a fallback value being the fontSize * 1.2 (the average line height on most browsers).

Implemented in #11