Skip to content

Deleting an Additional CSS Class attribute leaves an empty className attribute in the HTML comment code #11664

@dianeco

Description

@dianeco

Describe the bug
When you delete an Additional CSS Class, it leaves an empty className attribute in the HTML comment code.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a heading block and type some text
  2. In the Advanced panel, set an Additional CSS class
  3. Empty the Additional CSS class field
  4. Switch to Code Editor.
<!-- wp:heading {"className":""} -->
<h2>Heading</h2>
<!-- /wp:heading -->

Desktop:

  • OS: Windows 10, Mac OS
  • Browser; Chrome, Safari Firefox, Edge

Additional context
Gutenberg 4.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled later[Type] Code QualityIssues or PRs that relate to code quality[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions