Handle null return value of document.caretPositionFromPoint

This commit is contained in:
toasted-nutbread 2019-09-18 22:11:18 -04:00
parent e3fb9603e2
commit 02927f9004

View File

@ -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;