Skip to content

CodeMirror with ACF Textarea #9768

Closed as not planned
Closed as not planned

Description

@riemerta6

I have a Textarea field that I've created with Advanced Custom Fields. I have to so that the Textarea is replaced with a CodeMirror field (using plugin ACF Code Field). When I "Update" with the Gutenberg editor, it does not save the contents of the CodeMirror field. I have a feeling this is because the actual Textarea is not being saved. It does save when I'm not using Gutenberg. I submitted a note to the plugin creator about this, but I thought I would also post something here.

To Reproduce
Steps to reproduce the behavior:

  1. Create ACF Code Field

  2. Edit ACF Code Field on Page

  3. Update page with Gutenberg active
    / breaks here

  4. Create ACF Code Field

  5. Edit ACF Code Field on Page

  6. Update page without Gutenberg active

  7. Field is updated!

I've tried this in the latest versions of Firefox and Chrome

Gutenberg Version 3.7.0

Activity

  1. added
    [Type] Plugin InteroperabilityIncompatibilities between a specific plugin and the block editor. Close with workaround notes.
    on Sep 11, 2018
  2. designsimply commented on Sep 11, 2018

    @designsimply
    Member

    Thank you for posting! Would you mind sharing the link where you reported the issue to the plugin creator so we can follow along or did you report that via email or through a private support system that you can't link to?

  3. riemerta6 commented on Sep 11, 2018

    @riemerta6
    Author
  4. youknowriad commented on Dec 25, 2018

    @youknowriad
    Contributor

    Is this still an issue? I know both ACF and Gutenberg have been updated to fix conflicts.

  5. riemerta6 commented on Dec 27, 2018

    @riemerta6
    Author
  6. youknowriad commented on Dec 27, 2018

    @youknowriad
    Contributor

    Thanks for the heads-up, make sure to follow up with in the ACF repo as well. More insights might help us see how we can provide compatibility for this if needed.

  7. riemerta6 commented on Apr 13, 2019

    @riemerta6
    Author

    I wanted to follow up on this issue. After digging deeper, I have realized it doesn't have anything to do with ACF or the plugin mentioned above. It has to do with how CodeMirror is initialized (by replacing textarea/metabox). Any ideas on how to save the edits to the metabox when CodeMirror is being used and Gutenberg is active on the page? What if everything typed in CodeMirror was copied to textarea using JavaScript?

  8. t-hamano commented on Dec 17, 2023

    @t-hamano
    Contributor

    I have to so that the Textarea is replaced with a CodeMirror field (using plugin ACF Code Field).

    If you mean this by a plugin called ACF Code Field, it looks like this plugin is already closed.

    Instead I tried Advanced Custom Fields: Extended which allows us to add the code editor field. (This plugin requires ACF Pro version, but luckily I had a permanent license)

    From what I've tried with this plugin, it appears to apply CodeMirror to the field and persist code changes even after I save the post and reload the browser.

    code-editor

    In any case, I think this issue is an implementation issue when applying Codemirror to Metabox, so I would like to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Plugin InteroperabilityIncompatibilities between a specific plugin and the block editor. Close with workaround notes.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions