From 054cf9770678bf240dbf27a1644847ed00d9ec66 Mon Sep 17 00:00:00 2001 From: Erik Beijerman Date: Tue, 4 Jul 2017 11:09:40 +0200 Subject: [PATCH] Added undefined check and fallback on startContainer.getBoundingClientRect --- src/js/extensions/paste.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/extensions/paste.js b/src/js/extensions/paste.js index ece31869d..ea3d5ca5b 100644 --- a/src/js/extensions/paste.js +++ b/src/js/extensions/paste.js @@ -297,8 +297,10 @@ // on empty line, rects is empty so we grab information from the first container of the range if (rects.length) { top += rects[0].top; - } else { + } else if (range.startContainer.getBoundingClientRect !== undefined) { top += range.startContainer.getBoundingClientRect().top; + } else { + top += range.getBoundingClientRect().top; } }