-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation block: Add horizontal movers #16637
Comments
This would be the addition of an cc @felixarntz as this seems relevant to what you have been doing in AMP-stories territory. |
At this moment the Here are some solutions:
There are some other options though. First, it bothers me that while vertical movers are standard horizontal movers vary: the gallery has horizontal arrows positioned absolutely on top of gallery items, the navigation block has horizontal movers positioned inline next to menu items. It feels off somehow. So, one option would be to not have horizontal or even simpler like this: Second, maybe the whole movers thing could be improved for all the blocks if we implement something else in
So, are we sold with this idea that the Because if we are then, imho, the best way is to implement them custom in |
In order to get this option working for both the Nav Menu block and a Gallery that has inline blocks (and maintain tab order), I think there would need to be two additional
The styling for these movers will be pretty complicated, which is why I think a |
In reading through this thread, it reads to me as if the biggest argument for duplicating the block mover code is that it makes it possible to apply some stylistic changes that are not possible currently, is that correct? I love a challenge, so I would love to understand what style we want and what makes that possible with the current approach. I read this:
What about the horizontal layout makes it hard to accomplish the horizontal movers based on what we have today? If it helps, I can create an example PR where I unhide the movers from the recently merged Social Links block, and style those to be horizontal. Note I do think in general that the block mover needs a lot of love. But those benefit deserve to benefit block movers everywhere, not just in nested blocks, IMO. |
After a lot of fiddling with the CSS ( cc @jasmussen ) in which I basically added a wrapper and used a CSS grid to move the movers around I gave up and found no way to make them stay in the same place in the DOM and look like this: Therefore I went ahead and updated #16615 to have the BlockMover component be passed into any kind of BlockEdit. There each block which needs horizontal movers can render them wherever it sees fit: The styling is crap because the MenuItem component is incomplete and has some outdated UI. |
@jasmussen I personally think tab order is the main issue. I'm sure there's lots that's achievable using purely CSS, but afaik CSS can't solve that the mover is after the content in the nav menu item, and before it everywhere else. Happy to be proven wrong though 😄 |
This is more of a proof of concept and experiment, than it is final PR. So *do not merge as is*. We might find that we like this, in which case it might need a little polish, and _then_ we can ship it. But for now this PR has been created to help further discussion in #16637. This PR does the following: - Starts with Social Links, because that is the first block to "absorb child block UI", and therefore a good test-bed for this. - Additionally, Social Links has been merged with _no mover controls_. This PR resurfaces them. - It restyles, positions, and rotates the mover control to be horizontal. - It restyles and positions the ellipsis menu. The overall pattern it mimics, is that of gallery items, which also have horizontal movers, even though those are not yet technically child blocks. Your feedback is much apprecated.
Hey @talldan and @draganescu, thanks for blazing on with this, your work is very helpful in understanding the challenges involved, I know I've had a hard time understanding the intricacies. So these examples have been very helpful, to the point that I took a stab myself in #17627. Basically it sounds like the primary motivator for making the block mover into a subcomponent, was to show it inline and to the right of the child item. For that reason I took a different approach, kept them where they are and just re-did them, kind of like Andrei did in one of the GIFs here: #16637 (comment) I don't necessarily think this is the IDEAL solution, but it is a CSS-only solution that we can refine as we go, and it keeps with the idea of keeping the block, notably the innerblocks feature, as simple as we can for developers. Would very much appreciate your thoughts. |
This issue is almost completed by #16615 which is missing a final review. |
@draganescu Looks like the movers are not showing correctly in the top toolbar. See #19565. |
Hi @ellatrix I am afraid I'll need to get more up to date with moving the movers to the toolbar and what that means for how they work. I'll check the issue you opened and comment there. |
Some blocks have inner blocks that need to be moved horizontally, for example the menu block, the gallery block and the columns block. The block mover assumes that only vertical rearrangement is possible, so we need to implement a way to allow horizontal rearrangement.
The text was updated successfully, but these errors were encountered: