From 7d88cfde0e60f5015749dfb4017b749967ec3178 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Wed, 6 Dec 2017 19:36:13 +0530 Subject: [PATCH] Skip paste handling if composer textarea lost focus --- app/assets/javascripts/discourse/components/d-editor.js.es6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 8249fd065dd..add37c5a8c2 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -640,6 +640,10 @@ export default Ember.Component.extend({ }, paste(e) { + if (!$(".d-editor-input").is(":focus")) { + return; + } + const { clipboard, types } = clipboardData(e); const placeholder = `${ I18n.t('pasting') }`; let plainText = clipboard.getData("text/plain");