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

fix: ensure that offset is positive in findDomRange (#1719)

This commit is contained in:
Ben Southgate
2018-03-22 17:48:09 -04:00
committed by Ian Storm Taylor
parent bff3d34a2d
commit 804ea5d4d0

View File

@@ -29,7 +29,7 @@ function findDOMPoint(key, offset, win = window) {
if (offset <= end) {
const o = offset - start
return { node: n, offset: o }
return { node: n, offset: o >= 0 ? o : 0 }
}
start = end