1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

fix findDOMPoint behavior for void nodes

This commit is contained in:
Ian Storm Taylor
2018-11-06 12:53:05 -08:00
parent 88aa5a5cc8
commit 7079433ac1

View File

@@ -21,10 +21,7 @@ function findDOMPoint(point, win = window) {
for (const text of texts) {
const node = text.childNodes[0]
// Account zero-width spaces which shouldn't really take up space, because
// we only render them when the text is empty.
const length = node.textContent === '\uFEFF' ? 0 : node.textContent.length
const { length } = node.textContent
const end = start + length
if (point.offset <= end) {