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

@gziolo gziolo 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.

@gziolo gziolo added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Block] Columns Affects the Columns Block [Block] Group Affects the Group Block labels May 17, 2019
@gziolo gziolo self-assigned this May 17, 2019
@gziolo gziolo added [Type] Bug An existing feature does not function as intended Needs Design Feedback Needs general design feedback. labels May 17, 2019
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

kjellr 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 gziolo removed the Needs Design Feedback Needs general design feedback. label May 17, 2019
@gziolo
Copy link
Member Author

gziolo 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
@gziolo gziolo deleted the fix/no-way-to-drop-block-with-button-appender branch May 20, 2019 07:58
@mapk
Copy link
Contributor

mapk 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

@getdave
Copy link
Contributor

getdave 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
Labels
[Block] Columns Affects the Columns Block [Block] Group Affects the Group Block [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants