Support » Plugin: Jetpack by WordPress.com » Gutenberg Form doesn’t keep the Additional CSS class

  • Resolved luigipulcini

    (@luigipulcini)


    Hello.

    When adding a JetPack Form block in the Gutenberg editor, the block doesn’t seem to keep the Additional CSS class.

    How to reproduce the issue:

    • create a new post or page in the Gutenberg editor
    • add a new Form block to the page
    • in the Advanced section of the block settings panel, write anything in the Additional CSS class text box
    • update the post
    • reload the page in the browser

    When the page reloads and you access the block settings panel again, the Additional CSS class text box is empty.

    Best,
    Luigi.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    This is somewhat expected behavior, it’s best to think of the Contact Form block as a nested block.

    When you first set up the form, you have the option to set a class for the _entire_ form. Once saved, what’s returned are separate blocks for each _field_ of the form.

    Now, each field’s block can have its own class, and that’s what you’re seeing as empty. So, you have set a form-wide class, but you haven’t set a class for the first field block yet, for example.

    If instead of selecting a field block, like “From,” you click down to the form’s “Submit” button in the editor, that selects the full form’s block, and you’ll see that your original form-wide class is still set.

    Thanks for the prompt reply.

    Actually, I was not talking about the single elements of the form but indeed the whole form. If you select the form you can see that the Additional CSS class is there, even after pressing the Update button. BUT, when you reload the page the form-wide class is gone! And the HTML markup doesn’t have any sign of the Additional CSS class anywhere.

    Even looking at the block from the code editor, you can see the className attribute until you reload the page: when you do so, the additional class is gone.

    I hope this clarifies.

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    You are absolutely right, thanks for clarifying!

    I can reproduce this under a fresh WordPress 5.2.2 site, with Jetpack 7.5.2 and Twenty Nineteen 1.4.

    Would you like to do the honors of reporting it at https://github.com/Automattic/jetpack/issues/new?template=bug_report.md ? 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.