From 86c15305884fb9fc10554115dc5ba208e0584804 Mon Sep 17 00:00:00 2001 From: Olha Kurkaiedova Date: Fri, 5 Jan 2018 00:04:36 +0200 Subject: [PATCH] Fix ability to copy-paste code from snippet page In case of CodeMirror has readOnly 'nocursor' option the text cannot be copied because CodeMirror loose its focus. That basically menas we can't use this option and we need to use some sort of workaround. One way to solve this is by using readOnly true option and hidding the blinking cursor with css rule. --- src/components/Snippet.jsx | 2 +- src/styles/common/overwrite.styl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Snippet.jsx b/src/components/Snippet.jsx index e4e76e8..99e178c 100644 --- a/src/components/Snippet.jsx +++ b/src/components/Snippet.jsx @@ -69,7 +69,7 @@ class Snippet extends React.Component {
diff --git a/src/styles/common/overwrite.styl b/src/styles/common/overwrite.styl index cf12223..f84b85d 100644 --- a/src/styles/common/overwrite.styl +++ b/src/styles/common/overwrite.styl @@ -22,3 +22,7 @@ .snippet .CodeMirror-line padding-left: 20px !important + +.snippet .CodeMirror-cursor { + display: none !important +}