Comments (5)
Sorry I found that we can pass readonly
option while creating editor.
var editor = monaco.editor.create(element.nativeElement, {
model: null,
readOnly: true
});
from monaco-editor.
@James9074 editorInstance.updateOptions({ readOnly: true })
or editorInstance.updateOptions({ readOnly: false })
as @andyg8180 mentions will do the trick.
from monaco-editor.
Has anyone seen a reliable way to change this post-creation?
from monaco-editor.
@James9074 try this action on the code editor:
https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.icodeeditor.html#updateoptions
and then check out readonly here:
https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html
from monaco-editor.
Hey that actually worked! Thanks @elAndyG and @alexandrudima. I was getting caught up in the doc's typing and forgot I could just pass a json object into updateOptions
to make that work.
from monaco-editor.
Related Issues (20)
- [Bug] paste by ctrl+v not working inside editor after update to 0.46.0 HOT 1
- [Bug] Glyph margin decorations/widgets for deleted lines not rendering in the inline view
- [Bug] createScopedLocalize is undefined HOT 1
- [Bug] Crash / Slowness when JSON Schema is applied
- [Bug] Can't automatic init webworker
- [Bug] Sticky scroll toggle does not work
- [Bug] Trying to fetch loader script get 403/421 cloudflare cdn link is probably broken HOT 8
- [Bug] Inline Completions doesn't respect word wrapping when rendering (ghost text) parts of an inline suggestion as additional lines (using view line)
- [Bug] toolbar background of inline completion is broken
- [Bug] simpleWorker.nls.js fails to load if vs path does not end in 'vs'
- [Bug] Safari: non-https site reports `undefined is not an object (evaluating 'navigator.clipboard.write')`
- [Feature Request] Can we have a predicate to decide if a completion popup should be displayed?
- [Bug] editor.EditorZoom.setZoomLevel doesn't set the scale for lightBulb icon
- [Bug] loadForeignModule error after I use editor with language json
- [Bug] tip position calculate error
- [Bug] when the option readOnly is true, the marker function is not running HOT 1
- [Question] findWithArgs searchString unable to use
- `csp.contribution.ts` is missing the file extension HOT 1
- Editor text is centered instead of left HOT 1
- [Bug] Syntax highlighting issue when typing quote character
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monaco-editor.