Fix handling of copy-paste in composer fields after #787 changes

This commit is contained in:
Ben Gotow 2018-04-03 16:48:22 -07:00
parent 7868823b22
commit 7d56a7bafe

View file

@ -23,11 +23,14 @@ const isTextInput = node => {
};
const isSelectionPresent = () => {
let doc = window.document;
if (doc.activeElement && doc.activeElement.nodeName === 'IFRAME') {
doc = doc.activeElement.contentDocument;
if (
document.activeElement &&
document.activeElement.closest('[contenteditable]') &&
document.getSelection().toString().length === 0
) {
return false;
}
return doc.getSelection().toString().length > 0;
return true;
};
// Handles low-level events related to the window.