Feature: Readonly editor with state updates & listeners
See original GitHub issueI have a usecase where:
- I don’t want the editor to be editable by the user
- I want the capability to receive editor updates and subscribe to commands like click, drag, etc.
So far, I haven’t been able to find a clean solution that achieves both. Setting the editor to readonly
in the initialConfig
‘freezes’ the editor thereby achieving (1) but not (2).
It would be nice to have an editor that is non-editable but can still hooked up to the in-built listeners.
For react, having a prop that can override isReadOnly
in the LexicalContentEditable seems to be one way to achieve this.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Is there a way to set editor to readOnly when you can only ...
updateListener. An editorView object is created with new EditorView, passing a state with EditorState.create. Then the editorView.dom is ...
Read more >Configuration - Editor.js
After you create a new EditorJS object, it will contain isReady property. It is a Promise object that will be resolved when the...
Read more >Configure read-only routing for an Always On availability group
Automatically route all read-only traffic to a secondary replica using ... Create or Configure an Availability Group Listener (SQL Server).
Read more >Class Editor (CKEDITOR.editor) - CKEditor 4 API docs
editor #status ... Indicates editor initialization status. The following statuses are available: unloaded: The initial state — the editor instance was initialized, ...
Read more >VS Code API | Visual Studio Code Extension API
The function is sometimes also called command handler. Commands can be added to the editor using the registerCommand and registerTextEditorCommand functions.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pguduguntla The solution I went with is to leave the global lexical editor readonly state as
false
and instead use a custom ‘readonly’ contenteditable in the text plugin.Custom ReadOnlyContentEditable.ts
Usage in LexicalPlainTextPlugin
@yudori Oh sweet! That works for my use case, thanks so much man!