Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readonly mode for editor #403

Open
ponyr1der opened this issue Oct 3, 2024 · 3 comments
Open

Add readonly mode for editor #403

ponyr1der opened this issue Oct 3, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ponyr1der
Copy link

Description

At this moment editor works only in edit mode, which means that we can't prevent user from making changes, if he is not allowed to make changes.

Proposal

Add readonly property to MarkdownEditorView

@ponyr1der ponyr1der added the enhancement New feature or request label Oct 3, 2024
@makhnatkin
Copy link
Collaborator

@ponyr1der We have a demo mode in the demo folder. But this issue concerns disabling editing mode.

Is the preview from the demo suitable?
Or do you need to disable the mode? For what purpose? Can you provide use cases?

@ponyr1der
Copy link
Author

I tried Preview using YfmStaticView, but it's not exactly what i need. I need a mode, where user can't change content of the markup, can only view, scroll, copy, and do other things, that do not mutate markup.

As an example - secure mode in Excel. If u download some xlsx file - it opens in secure (view only) mode, where you can view content, but can't make changes. To be able to change contect - you have to press button "Allow editing", and then Excel changes it's mode and you are able to make changes.

There is a lot of use cases for this feature, exactly mine one is that i need to prevent some users from making changes, but need to let them view content.

@makhnatkin
Copy link
Collaborator

Thanks for the explanation. This case is valid. We think that this can be solved by making the following changes:

  1. support for the read-only mode for the markuo editor. EditorState.readOnly, EditorView.editable
  2. support for the read-only mode for the WYSIWYG editor
  3. do not show the toolbar or disable it. We need to think about UX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants