-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add isReadOnly prop to KuiCodeEditor.
* Place cursor at beginning of code editor if it's read-only. * Surface prompt for isReadOnly mode. Only show cursor when the editor is focused.
- Loading branch information
Showing
6 changed files
with
336 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import 'brace/mode/less'; | ||
import 'brace/theme/github'; | ||
|
||
import { | ||
EuiCodeEditor, | ||
} from '../../../../src/components'; | ||
|
||
export default class extends Component { | ||
state = { | ||
value: '<p>This code is read only</p>' | ||
}; | ||
|
||
render() { | ||
return ( | ||
<EuiCodeEditor | ||
mode="less" | ||
theme="github" | ||
width="100%" | ||
value={this.state.value} | ||
setOptions={{ fontSize: '14px' }} | ||
isReadOnly | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.