mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
Fix handling of copy-paste in composer fields after #787 changes
This commit is contained in:
parent
7868823b22
commit
7d56a7bafe
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue