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

Add logic to prevent ungroup option when there are no inner blocks #16332

Merged
merged 1 commit into from
Jun 29, 2019

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Jun 27, 2019

Description

Prevents the ungroup option being displayed in the options menu when a group block has no inner blocks.

How has this been tested?

Added an e2e test

Manual testing:

  1. Add a group block
  2. Open the block more menu

Actual behaviour (master)
The ungroup option is visible, and when clicked does nothing

Expected behaviour ( this branch )
The ungroup option is not visible.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@talldan talldan added [Type] Bug An existing feature does not function as intended [Block] Group Affects the Group Block labels Jun 27, 2019
@talldan talldan self-assigned this Jun 27, 2019
@gziolo
Copy link
Member

gziolo commented Jun 27, 2019

For reference, this is how it works in master without this patch:
ungroup bug

@talldan talldan added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Jun 27, 2019
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Works well on my tests and the change looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants