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: Allow dropping blocks into blocks with button block appender #15702

Merged
merged 1 commit into from May 20, 2019

Conversation

@gziolo
Copy link
Member

commented May 17, 2019

Description

With the recent addition of the button block appender for Column and Group blocks it's no longer possible to drag a block when there is appender displayed. To work around it, you have to add any block using the appender first. This PR fixes it.

How has this been tested?

Add both Column and Group block to the existing post. Try to drag and drop any block and observer the block button appender being replaced with the selected block.

Screenshots

This is how it works with changes applied:

drop-block-button-appender

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.
@aduth
aduth approved these changes May 17, 2019
Copy link
Member

left a comment

I think this is an improvement, and a trivial change at that, so I'd agree to merge it as is.

That being said, I think it would be worth exploring design enhancements in the future which consider treating the entire button area as a droppable target. At least, that was my first intuition, and it was not obvious to me to need to place the cursor at the top edge of the button.

@kjellr

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

Tested, and this works for me too. 🎉

I agree, it would be cool to allow people do drag + drop on the actual appender itself as a later iteration. We could borrow the blue dropzone treatment we use elsewhere when the item is being dropped on the appender.

@gziolo gziolo added this to the 5.8 (Gutenberg) milestone May 17, 2019
@gziolo

This comment has been minimized.

Copy link
Member Author

commented May 17, 2019

Yes, this seems like a great improvement to use the whole area of the button. I will explore it further in a follow-up PR. I did a quick test earlier today with wrapping the button with the drop zone component but it didn’t work. I will try different approach.

@gziolo gziolo merged commit 19d1cbf into master May 20, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo deleted the fix/no-way-to-drop-block-with-button-appender branch May 20, 2019
@mapk

This comment has been minimized.

Copy link
Contributor

commented May 20, 2019

Excellent! Dragging and dropping on the appender itself would be awesome! I feel that would be a step in the right direction toward this: #13202

@kjellr kjellr referenced this pull request May 21, 2019
5 of 5 tasks complete
@getdave

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

@gziolo Glad this was a simple as I thought! 👍 Sorry for missing it first time around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.