react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

Editable properties causing loss of code formatting

Open lamtuanamc opened this issue 7 months ago • 1 comments

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.

lamtuanamc avatar Jun 29 '24 07:06 lamtuanamc