From a4984139632e15e0d8d95acdafb268a73c1878a5 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke <marijn@haverbeke.nl>
Date: Fri, 19 Aug 2016 10:39:49 +0200
Subject: [PATCH] Fix read-dom-on-paste workaround for IE

Issue #4091
---
 lib/codemirror.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/codemirror.js b/lib/codemirror.js
index 292eda96..58c45f45 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1583,7 +1583,9 @@
       on(div, "paste", function(e) {
         if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return
         // IE doesn't fire input events, so we schedule a read for the pasted content in this way
-        if (ie_version <= 11) setTimeout(operation(cm, function() {regChange(cm);}), 20)
+        if (ie_version <= 11) setTimeout(operation(cm, function() {
+          if (!input.pollContent()) regChange(cm);
+        }), 20)
       })
 
       on(div, "compositionstart", function(e) {
-- 
GitLab