editor.js
editor.js copied to clipboard
💡ReadyOnly on a per Block basis
With the great addition to ReadOnly setting the entire editor to contentEditable=false, it would great to implement this on a per block basis.
An example use case could be blocks received from an API where a parent user has set certain blocks that must be in an editor, while allowing a child user the ability to add / edit more.
a Block.ReadOnly could function the same as the editorJS readOnly by disabling the inline toolbar, as well as block settings.
To currently achieve this, I am passing readOnly: true to a block's data object
blocks: [
{
"type": "paragraph",
"data": {
readOnly: true,
"text": "Hello World",
},
},
]
Disabling contentEditable on the Block element, then hiding the inline toolbar and block settings button. Works, but not ideal.
Thoughts on this as a feature?
Could be an additional property to each Block in data.
blocks: [
{
"type": "paragraph",
"data": {
"text": "Hello World",
},
"config": {
"readOnly": true,
}
},
]
Wonderful feature, hope to use it.
+1 to this feature!
Is this function implemented?
I'd like to use editor.js to create simple forms / survey type pages and then display the page in readonly mode but allow the viewer to enter data in to textbox, checkbox, radio button fields and then have that data saved. This feature would help with this but maybe not deliver the full functionality