ronds-metadata 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,7 +87,7 @@ var SqlEdit = function SqlEdit(props) {
87
87
  tabSize: 4,
88
88
  mode: mode,
89
89
  theme: theme,
90
- readOnly: readOnly,
90
+ readOnly: readOnly ? 'nocursor' : readOnly,
91
91
  lineNumbers: isLineNumbers,
92
92
  lineWrapping: true,
93
93
  foldGutter: true,
@@ -128,12 +128,13 @@ var SqlEdit = function SqlEdit(props) {
128
128
 
129
129
  if (value) {
130
130
  editorRef.current.setValue(value);
131
+ editorRef.current.focus();
132
+ editorRef.current.setCursor(editorRef.current.lineCount(), 0);
131
133
  }
132
134
  }, [value]);
133
135
  React.useEffect(function () {
134
136
  if (!editorRef.current) return;
135
- debugger;
136
- editorRef.current.setOption('readOnly', readOnly);
137
+ editorRef.current.setOption('readOnly', readOnly ? 'nocursor' : readOnly);
137
138
  editorRef.current.setOption('lineNumbers', isLineNumbers);
138
139
  editorRef.current.setOption('gutters', isGutters ? ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'] : []);
139
140
  }, [readOnly, isLineNumbers, isGutters]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.0.36",
4
+ "version": "1.0.37",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",