Skip to content

Ensure default block classname is used as the root of other classes #14725

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

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

pablinos
Copy link
Contributor

We've been using the className prop to compose other class names for
the layout of the block edit component. e.g. ${ className }-overlay.

As pointed out by @jeherve in #14623, this breaks if additional CSS
classes are added to the block in the advanced settings.

Fixes #14623

Changes proposed in this Pull Request:

This change, uses getBlockDefaultClassName to get the default class
name to use instead.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

This is a bug fix for the Calendly and OpenTable blocks

Testing instructions:

As per the bug report in #14623, create a Calendly and/or an OpenTable block, and check that you can add additional CSS classes, without it affecting the class names of the blocks internal markup.

Proposed changelog entry for your changes:

  • Fixed a bug with the Calendly and OpenTable blocks that meant additional CSS classes would break the classes applied to the block in the editor.

We've been using the `className` prop to compose other class names for
the layout of the block edit component. e.g. `${ className }-overlay`.

As pointed out by @jeherve in #14623, this breaks if additional CSS
classes are added to the block in the advanced settings.

This change, uses `getBlockDefaultClassName` to get the default class
name to use instead.
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello pablinos! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D39070-code before merging this PR. Thank you!

@jetpackbot
Copy link
Collaborator

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: March 3, 2020.
Scheduled code freeze: February 25, 2020

Generated by 🚫 dangerJS against 002111d

@jeherve jeherve added this to the 8.3 milestone Feb 19, 2020
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about getBlockDefaultClassName! This seems to work just fine! 👍

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Feb 19, 2020
Copy link
Member

@scruffian scruffian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeherve jeherve merged commit d498796 into master Feb 24, 2020
@jeherve jeherve deleted the fix/default-classname branch February 24, 2020 07:11
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Feb 24, 2020
@scruffian
Copy link
Member

r203264-wpcom

jeherve added a commit that referenced this pull request Feb 25, 2020
jeherve added a commit that referenced this pull request Feb 25, 2020
* 8.3 release: changelog

* Changelog: add #14516

* Changelog: add #14574

* Bring in changes from 8.2.1 and 8.2.2

* Update stable version

* Bring in 8.2.3 changes

* Changelog: add #14714

* Changelog: add #14639

* Changelog: add #14678

* Changelog: add #14673

* Changelog: add #14687

* Changelog: add #14704

* Changelog: add #14702

* Changelog: add #14541

* Changelog: add #14657

* Changelog: add #14622

* Changelog: add #14582

* Changelog: add #14638

* Changelog: add #14633

* Changelog: add #14571

* Changelog: add #14592

* Changelog: add #14539

* Changelog: add #14514

* Changelog: add #14643

* Changelog: add #14494

* Changelog: add #13739

* Changelog: add #14707

* Changelog: add #14736

* Changelog: add #14706

* Changelog: add #14730

* Changelog: add #14685

* Changelog: add #14727

* Changelog: add #14711

* Changelog: add #14742

* Changelog: add #14746

* Changelog: add #14725

* Changelog: add #13999

* Changelog: add #14740

* Changelog: add #14759

* Changelog: add #14703

* Changelog: add #14753

* Changelog: add #14754

* Changelog: add #14645

* Cahngelog: add #14599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendly / OpenTable: layout issues when using custom CSS class
5 participants