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

Implement some kind of read-only mode #173

Closed
marijnh opened this issue Mar 16, 2020 · 1 comment
Closed

Implement some kind of read-only mode #173

marijnh opened this issue Mar 16, 2020 · 1 comment

Comments

@marijnh
Copy link
Member

@marijnh marijnh commented Mar 16, 2020

Just setting contenteditable to false on the content element sort of gets us an uneditable editor, but breaks some things. The main issue seems to be that the view refuses to update the DOM selection unless the editor has focus. But a non-editable element isn't (by default) focusable.

Relevant ProseMirror thread. There we ended up with an option to turn off editing, and automatically adjust selection handling to account for the different focus behavior. That might be a good idea here as well.

marijnh added a commit that referenced this issue Mar 16, 2020
@marijnh

This comment has been minimized.

Copy link
Member Author

@marijnh marijnh commented Mar 16, 2020

Patches 1fb409a and 5438638 roughly implement this. You provide something like EditorView.editable.of(false) to make the content uneditable. Let's open new issues when problems are found.

@marijnh marijnh closed this Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.