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 && ( )}