react-codemirror
react-codemirror copied to clipboard
Editable properties causing loss of code formatting
I am encountering an issue with the editable
and readOnly
properties in react-codemirror. Both properties are described as disabling editing of the editor content by the user:
editable: This disables editing of the editor content by the user.
readOnly: This disables editing of the editor content by the user.
However, I have noticed a problem where setting editable={false}
results in the loss of code formatting when reloading the page. To avoid this, I tried setting only readOnly={true}
, but this still allows the content to be editable.
Is there a way to ensure that when either editable={false}
or readOnly={true}
, the content cannot be edited while maintaining the code formatting?
Thank you for your assistance.