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

Navigation block item breaks on mobile #18401

Closed
draganescu opened this issue Nov 8, 2019 · 7 comments
Closed

Navigation block item breaks on mobile #18401

draganescu opened this issue Nov 8, 2019 · 7 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@draganescu
Copy link
Contributor

Describe the bug
When inserting or editing a navigation item on mobile, the toolbar of the menu item breaks on multiple lines.

Expected behavior
It should stick to the bottom of the navigation menu block instead of being anchored to the navigation menu item.

Screenshots

Screenshot 2019-11-08 at 15 30 56

Smartphone (please complete the following information):

  • Device: IPhone Simulator
@draganescu draganescu added the [Type] Bug An existing feature does not function as intended label Nov 8, 2019
@getdave
Copy link
Contributor

getdave commented Nov 8, 2019

It should stick to the bottom of the navigation menu block instead of being anchored to the navigation menu item.

@draganescu This relates to

#18336 (comment)

@mtias is there any precedent for this behaviour for nested Blocks' toolbars?

@karmatosed
Copy link
Member

@shaunandrews looping you in for this as my feelings are we might have to simplify things or at least look at stopping overlaps.

68602276-f41ae000-049d-11ea-8387-10759e581d09

68602240-e6fdf100-049d-11ea-9112-2ec2ddda9bd4

68602206-d64d7b00-049d-11ea-98cc-0c7d90af497b

68602182-cdf54000-049d-11ea-853d-f1a26e33627f

@shaunandrews
Copy link
Contributor

At the very least the Link UI needs to better adjust on mobile screens—perhaps a modal overlay, instead of the positional popover.

In the screenshots above, it seems like some of the spacing and positioning of the toolbar is just plain broken. This doesn't appear to be a problem specific to the Navigation block (though it is definitely impacted) and is more related to nested blocks in general — the toolbar tries to respect the nested paddings/margins.

Instead, I think the toolbar should always be positioned to the left edge of small viewports and likely full-width.

@frontdevde
Copy link
Contributor

frontdevde commented Nov 14, 2019

I just had a brief look at the issue and what seems to happen is the following:

On other blocks, we make use of absolute positioning for the toolbar to appear below the block. That works well for the main toolbar of this block as well but breaks down for the toolbar on the individual items:

mobile-subnav-current

That is because for the individual items there are now a few different elements in between that set position relative. We could reset those to the initial state on mobile. That would somewhat work but it breaks down the moment the user would click the button to toggle the item position. The issue there is that the transform creates a new stacking context. So the item changes position during the animation and then jumps to full width the moment the animation stops:

mobile-stacking-context-issue

With this in mind, what would probably be the most straightforward solution, for now, is to make each of the menu items full width on mobile. This way each block stretches over the full width and the toolbar can just be positioned at the bottom of the menu item just as with any other block.

@draganescu
Copy link
Contributor Author

make each of the menu items full width on mobile.

Interesting exploration @frontdevde, thank you! I believe this idea above is a good approach since usually navigation at mobile phone breakpoints is indeed stacked.

@frontdevde
Copy link
Contributor

We're working on the mobile toolbar over in #18686. This is what the navigation block looks like on mobile with the current state of that PR.

ezgif com-video-to-gif (3)

So if we can land the changes we're attempting to make to the mobile toolbar in general, this should also fix the UX issues we're seeing with the navigation block submenu toolbars.

@frontdevde
Copy link
Contributor

Fixed by #18686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants