mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-01 04:50:27 +02:00
Fix toSlatePoint wrong offset for void element. (#4057)
This commit is contained in:
@@ -483,6 +483,9 @@ export const ReactEditor = {
|
||||
textNode = leafNode.closest('[data-slate-node="text"]')!
|
||||
domNode = leafNode
|
||||
offset = domNode.textContent!.length
|
||||
domNode.querySelectorAll('[data-slate-zero-width]').forEach(el => {
|
||||
offset -= el.textContent!.length
|
||||
})
|
||||
}
|
||||
|
||||
// COMPAT: If the parent node is a Slate zero-width space, editor is
|
||||
|
Reference in New Issue
Block a user