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

Hide B I U buttons on iOS #526

Closed
fabianmichael opened this issue Jun 29, 2021 · 3 comments
Closed

Hide B I U buttons on iOS #526

fabianmichael opened this issue Jun 29, 2021 · 3 comments

Comments

@fabianmichael
Copy link

When selecting text within the editor, iOS displays an in-place toolbar, which falsely contains buttons for formatting text as bold/italic/underlined. By adding the following property to the default style, this can be oppressed. It probably happens, because CM uses contenteditable.

-webkit-user-modify: read-write-plaintext-only;

Sorry, don’t have time to prepare a proper PR right now, but did not want this to get lost.

@marijnh
Copy link
Member

marijnh commented Jun 29, 2021

I didn't know about that CSS rule. Thanks for digging that up. Attached patch adds it.

@fabianmichael
Copy link
Author

fabianmichael commented Jun 29, 2021

@marijnh Me neither, found it buried in some Stackoverflow post, but not in the WebKit docs. At least, it works! 🙃

@pazdera
Copy link

pazdera commented Jul 11, 2021

This change seems to affect the ability to make the editor read-only (at least in Chrome) with @codemirror/view@0.18.18.

When I use the EditorView.editable.of(false) extension, the editor remains editable even though contenteditable is set to false. Removing the -webkit-user-modify property in the dev tools makes the editor uneditable again.

Should I start a new issue for this?

marijnh added a commit to codemirror/view that referenced this issue Jul 12, 2021
So that it isn't enabled when editable is false.

FIX: Fix a regression where `EditorView.editable.of(false)` didn't disable
editing on Webkit-based browsers.

Issue codemirror/dev#526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants