uiwjs / react-codemirror

CodeMirror 6 component for React. @codemirror https://uiwjs.github.io/react-codemirror/
https://uiwjs.github.io/react-codemirror/
MIT License
1.69k stars 134 forks source link

How to remove dotted line on focus? #643

Closed justin-ms closed 7 months ago

justin-ms commented 8 months ago

See top of image attached. This dotted line appears at the top and bottom of my editor upon focus.

Screenshot 2024-03-30 at 8 27 56 PM

jaywcjlove commented 7 months ago

@justin-ms

jaywcjlove commented 7 months ago
const styleTheme = EditorView.baseTheme({
  "&.cm-editor.cm-focused": {
    outline: "0 solid orange"
  }
});

export default function App() {
  return (
    <div>
      <CodeMirror
        value="console.log('hello world!');"
        height="200px"
        extensions={[styleTheme, javascript({ jsx: true })]}
        onChange={(value, viewUpdate) => {
          console.log("value:", value);
        }}
      />
    </div>
  );
}
justin-ms commented 7 months ago

Thank you @jaywcjlove!