From 1acbdf0529ded5ff1636d652147cc56ab78b6f13 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sat, 21 Mar 2020 16:44:42 -0700 Subject: [PATCH] fix copy text from embed bug Closes #972 --- components/Carbon.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index 764e7bb..8dc1d07 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -307,6 +307,11 @@ class Carbon extends React.PureComponent { ) + const selectionNode = + !this.props.readOnly && + !!this.state.selectionAt && + document.getElementById('style-editor-button') + return (
{content}
- {!this.props.readOnly && - this.state.selectionAt && + {selectionNode && ReactDOM.createPortal( , // TODO: don't use portal? - document.getElementById('style-editor-button') + selectionNode )}