Skip to content

Commit e4ed8e3

Browse files
authored
Fixed minor typos and misleading instructions
1 parent 450b664 commit e4ed8e3

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/documentation/docs/controls/MonacoEditor.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Monaco Editor control
22

3-
This control is a implementatiopn of Monaco Editor.
3+
This control is an implementation of the Monaco Editor. The Monaco Editor is the code editor that powers [VS Code](https://github.com/microsoft/vscode).
44

55
Here is an example of the control:
66

@@ -30,22 +30,33 @@ import { MonacoEditor } from "@pnp/spfx-controls-react/lib/MonacoEditor";
3030
```
3131

3232
- The `onValueChange` change event returns the upadated code and array with messages of errors on validation and can be implemented as follows:
33-
**this validation is done only to JSON language
33+
34+
> This validation is only available for JSON language
35+
36+
Your `onValueChange` handler would follow a similar format to this:
37+
38+
39+
```TypeScript
40+
const onValueChange = (newValue: string, validationErrors: string[]): void => { console.log(newValue); };
41+
```
42+
43+
Or, if using React Hooks:
3444

3545
```TypeScript
3646
const onValueChange = React.useCallback((newValue: string, validationErrors: string[]): void => {console.log(newValue);} , []);
3747
```
3848

49+
3950
## Implementation
4051

4152
The `MonacoEditor` control can be configured with the following properties:
4253

4354
| Property | Type | Required | Description |
4455
| ---- | ---- | ---- | ---- |
4556
| value | string | yes | default content for editor |
46-
| theme | string | no | theme used by editor , two themes are supported 'vs' and 'vs-dark', default 'vs' |
47-
| readOnly | boolean | no | indecate if editor is in read only mode |
48-
| showLineNumbers | boolean | no | editor show linenumber or not, default : yes|
57+
| theme | string | no | theme used by editor, two themes are supported 'vs' and 'vs-dark', default 'vs' |
58+
| readOnly | boolean | no | indicate if editor is in read-only mode |
59+
| showLineNumbers | boolean | no | editor show line number or not, default : yes|
4960
| onValueChange |(newValue:string, validationErrors:string[]) => void | no | function to get code changes, return an array with validation error in case of language is 'JSON' |
5061
| language |string | yes | editor code language, please see https://microsoft.github.io/monaco-editor/index.html for supported languages|
5162
| jsonDiagnosticsOptions |monaco.languages.json.DiagnosticsOptions | no | define options to JSON validation, please see https://microsoft.github.io/monaco-editor/index.html for more details |

0 commit comments

Comments
 (0)