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

Fix Block Controls behavior for List Block. #17876

Merged
merged 1 commit into from
Oct 10, 2019
Merged

Fix Block Controls behavior for List Block. #17876

merged 1 commit into from
Oct 10, 2019

Conversation

desaiuditd
Copy link
Member

Description

When toggling between Bulleted List and Numbered List, the Block Controls for List block disappears. You have to click inside the block to get them back. Ideally, the Block Controls should always be present, if the block is selected.

This seems to be introduced with #16962. Not sure if this behaviour is intentional or it's a legit bug. Happy to decline this PR if there's a reasoning behind current behaviour. @ellatrix would know better here.

How has this been tested?

After the fix is applied, the Block Controls always stays in the toolbar. So that I can easily toggle between Bulleted/Numbered List.

Screenshots

Before
2019-10-10 17 58 43
After
2019-10-10 18 10 23

Types of changes

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.

When toggling between Bulleted List and Numbered List, the Block Controls for List block disappears. You have to click inside the block to get them back. Ideally, the Block Controls should always be present, if the block is selected.
Copy link
Member

@ellatrix ellatrix left a comment

Choose a reason for hiding this comment

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

It looks like previously we used isSelected, which would still be true when the focus has left the rich text field. Omitting this condition entirely seems fine because there's only one rich text field in the block, and because the controls are for both the rich text field and the block.

@ellatrix
Copy link
Member

ellatrix commented Oct 10, 2019

Might be good to include this for WP 5.3 since it's a small regression from WP 5.2.

@gziolo gziolo added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Block] List Affects the List Block labels Oct 10, 2019
@ellatrix ellatrix merged commit 1ebb697 into WordPress:master Oct 10, 2019
@youknowriad youknowriad added this to the Gutenberg 6.7 milestone Oct 14, 2019
gziolo pushed a commit that referenced this pull request Oct 15, 2019
When toggling between Bulleted List and Numbered List, the Block Controls for List block disappears. You have to click inside the block to get them back. Ideally, the Block Controls should always be present, if the block is selected.
@desaiuditd desaiuditd deleted the fix-list-block-controls-behaviour branch May 10, 2020 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants