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: improve page jump experience in responsive modal #37387

Closed
cometgrrl opened this issue Dec 15, 2021 · 5 comments
Closed

Navigation Block: improve page jump experience in responsive modal #37387

cometgrrl opened this issue Dec 15, 2021 · 5 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@cometgrrl
Copy link

Description

When using a navigation block with a page jump, the page jumps aren't working on mobile.

Step-by-step reproduction instructions

  1. Create a navigation block menu
  2. Add a page jump to the menu
  3. Open the site on a mobile device
  4. Open the menu, tap on the page jump item in the menu

On the example site, this menu item is #after-image.

Expected: tapping the menu item for the page jump goes to the anchor
Actual: nothing happens

Screenshots, screen recording, code snippet

RPReplay_Final1639532064.mov

Environment info

https://dwtest-jetpackwf.mystagingwebsite.com/testing-navi-block/

Gutenberg plugin version: 12.1.0

Mobile: iOS 15.2, iPhone 12 Pro, Chrome 96.0.4664.94

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@annezazu annezazu added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended labels Dec 15, 2021
@annezazu
Copy link
Contributor

I can replicate this with 5.9 Beta 3. Thanks so much for your report!

@jasmussen
Copy link
Contributor

Thanks for reporting the issue! As I understand, when you're linking to an HTML anchor (for example a link to #after-image), you'd like the menu to close and navigate you to the particular item? Here's a GIF showing 3 types of links to an anchor:
link to subheading

I don't know that this one is a trivial one to solve, there are a few things going on:

  • Scrolling of the content below the modal is intentionally locked in place, so that the modal itself can scroll without scrolling the content underneath. This is what's preventing the jump from happening.
  • Closing the modal on click is likely going to affect the accessibility of the modal behavior, given that it's a dialog meant to close on Escape or when clicking the close button.

For single page applications, I would love to see the ability to have the modal menu jump to various page sections in an elegant way. I imagine it's non trivial to implement, though.

There's also an argument to be made that it's not a bug either: longer term, the contents of the modal will be editable, with the possibility to add subheadings with anchors directly inside the modal. In that context, you would be able to create anchor links that scrolled the contents of the modal, which would make sense for a modal FAQ for example.

@cometgrrl
Copy link
Author

I can see your point about having anchors within the modal. However, it seems broken to have a menu item that appears to do nothing.

@Mamaduka
Copy link
Member

Mamaduka commented Jan 5, 2022

I'm removing this issue from WP 5.9 project board since we're already in the RC phase.

Let's try to fix this for the next release.

@annezazu annezazu changed the title Navigation Block: on mobile, page jumps aren't working Navigation Block: improve page jump experience in responsive modal Feb 7, 2022
@Mamaduka
Copy link
Member

It was fixed via #39625.

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

No branches or pull requests

4 participants