mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +02:00
fix: ensure that offset is positive in findDomRange (#1719)
This commit is contained in:
committed by
Ian Storm Taylor
parent
bff3d34a2d
commit
804ea5d4d0
@@ -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
|
||||
|
Reference in New Issue
Block a user