Handle null return value of document.caretPositionFromPoint
This commit is contained in:
parent
e3fb9603e2
commit
02927f9004
@ -267,6 +267,9 @@ const caretRangeFromPoint = (() => {
|
||||
// Firefox
|
||||
return (x, y) => {
|
||||
const position = document.caretPositionFromPoint(x, y);
|
||||
if (position === null) {
|
||||
return null;
|
||||
}
|
||||
const node = position.offsetNode;
|
||||
if (node === null) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user