From 3ed64058119ff35c8da29c9568944edfd583bdcf Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Thu, 22 Aug 2019 11:50:25 -0700 Subject: [PATCH] remove selection capabilities from embed --- components/Carbon.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Carbon.js b/components/Carbon.js index 6563211..9bad6ef 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -75,6 +75,10 @@ class Carbon extends React.PureComponent { } onSelection = (ed, data) => { + if (this.props.readOnly) { + return + } + const selection = data.ranges[0] if ( selection.head.line === selection.anchor.line && @@ -313,7 +317,7 @@ class Carbon extends React.PureComponent { {content}
- {this.state.selectionAt && ( + {!this.props.readOnly && this.state.selectionAt && ( )}