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

#1954 fixes z-index issue of block mover buttons #1981

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion editor/block-mover/style.scss
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
top: 10px;
left: 0;
padding: 0 14px 20px 0; // handles hover area
z-index: z-index( '.editor-block-mover' );
Copy link
Member

Choose a reason for hiding this comment

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

If we're to remove this, the corresponding entry should also be removed from the editor/assets/stylesheets/_z-index.scss file.

Copy link
Author

Choose a reason for hiding this comment

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

@aduth That sounds like a good idea, and I think that at least lowering the z-index for the corresponding SASS style sheet would probably be the safer, less invasive alternative, since removing this line here ultimately would have the same effect of reducing the z-index in the corresponding SASS style sheet, just a much more lowering effect.

Forgive me if this is the wrong place to ask this, but while I have your attention on this issue, I'd like to ask a bigger question:

What is the plan for introducing the drag and drop ability for the blocks to re-order and position themselves by dragging them around, and perhaps add new blocks by dragging them in from a list of available block choices?

For a form-based editor WP plugin that I am building for a client, so that users can build forms by dragging around form elements and add in new form elements by dragging them in to the main form 'tree', I've worked considerably with react-sortable-tree, even creating the feature myself for giving its API the ability to drag in new external nodes, from this merged PR. React-sortable-tree's dragging ability is built solely on its bedrock of React-dnd.

I've enjoyed the abstracted, focus-on-the-data-not-the-DOM approach of React Dnd, and I am curious what you think of the possible application of React Dnd (or possibly even react-sortable-tree) is for Gutenberg.

Copy link
Member

Choose a reason for hiding this comment

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

There's a few related issues at #38 and #1511

My understanding is the general sentiment is that drag-and-drop is not a goal for primary block arrangement, but could be added as an enhancement on top of current arrangement tools. Drag-and-drop is tough to get right, and particularly so for long-content posts.

I don't have much personal experience with the two options you raised, aside from general awareness of their existing. I did have a hand in implementing a similar component in Calypso which could similar apply or inspire for a similar behavior in Gutenberg.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the response! I think the drag and drop ability for blocks within Gutenberg is definitely worth pursuing, and consensus in the community surrounding this, ultimately architectural, issue would be great, so the direction for accomplishing this could be seen as consistent and uniform. Just my two cents.


// Mobile, to be revisited
display: none;