uiwjs / react-codemirror

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

How to remove dotted line on focus? #643

Closed justin-ms closed 2 months ago

justin-ms commented 3 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 3 months ago

@justin-ms

jaywcjlove commented 3 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 2 months ago

Thank you @jaywcjlove!