react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

Can not select all text if editable={false}

Open kelokchan opened this issue 3 years ago • 1 comments

I have this code in the app for user to copy the code snippet, but I do not want the user to accidentally edit the code. I added editable={false} to the <CodeMirror /> component. But when I press cmd+A or ctrl+A, I couldn't select the text within the component.

            <CodeMirror
              editable={false}
              extensions={[html()]}
              width="100%"
              height="250px"
              value={`123123123123123`}
              style={{
                fontSize: '14px',
              }}
            />

kelokchan avatar Jan 19 '22 12:01 kelokchan

Yes, it becomes a page. You can capture shortcut keys to do what you want. @kelokchan

jaywcjlove avatar Jan 19 '22 12:01 jaywcjlove