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

Page List block inside navigation block will result invalid html #60500

Open
saulirajala opened this issue Apr 5, 2024 · 7 comments · May be fixed by #61482
Open

Page List block inside navigation block will result invalid html #60500

saulirajala opened this issue Apr 5, 2024 · 7 comments · May be fixed by #61482
Labels
[Block] Navigation Affects the Navigation Block Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Comments

@saulirajala
Copy link

saulirajala commented Apr 5, 2024

Description

page-list -block has features like showSubmenuIcon and openSubmenusOnClick that comes from the context provided by navigation -block, so I would assume that it's completely valid to use page-list block inside of navigation block. But doing so, will result invalid html since both navigation and page-list blocks starts with <ul>-element. So we would have <ul><ul><li>… structure, which is not allowed

Step-by-step reproduction instructions

  1. Add navigation block
  2. Add page-list block as inner block of navigation
  3. check the html tags

The live demo of this issue is in WordPress Playground: https://playground.wordpress.net/. Inspect the navigation in header.

Screenshots, screen recording, code snippet

Screenshot 2024-04-05 at 11 08 35

Environment info

  • WordPress 6.5
  • Twenty Twenty-Four

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

@saulirajala saulirajala added the [Type] Bug An existing feature does not function as intended label Apr 5, 2024
@jordesign jordesign added Needs Testing Needs further testing to be confirmed. [Block] Navigation Affects the Navigation Block labels Apr 7, 2024
Copy link

github-actions bot commented May 8, 2024

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label May 8, 2024
@saulirajala
Copy link
Author

The issue still exists. Even with the latest Gutenberg plugin installed. You can verify it via WordPress Playground https://playground.wordpress.net/?plugin=gutenberg

saulirajala added a commit to saulirajala/gutenberg that referenced this issue May 8, 2024
Fix issue with double ul-elements. Fix WordPress#60500
@saulirajala
Copy link
Author

saulirajala commented May 8, 2024

I did PR that fixes this. You can test it in Playground PR Reviewer
Screenshot 2024-05-08 at 11 00 50

@saulirajala
Copy link
Author

Actually my solution will introduce another issue: the ul.wp-block-page-list -element&class is missing from DOM, which is not good. So we need to think another way to fix this.

@saulirajala
Copy link
Author

saulirajala commented May 8, 2024

Seems like core/navigation -block already has functionality to wrap inner block with <li>, but core/page-list -block was just missing from $needs_list_item_wrapper -list. Added it there, which seems to solve the issue. You can test the PR in Gutenberg PR reviewer

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label May 9, 2024
Copy link

github-actions bot commented Jun 8, 2024

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jun 8, 2024
@saulirajala
Copy link
Author

This is still an issue even with WordPress 6.7 RC2 and the new twentytwentyfive theme. You can test the issue in RC2 playground. I updated the pr since it had merge conflicts.

Any change to get this fixed before WP6.7 release?

@getdave getdave changed the title page-list block inside navigation block will result invalid html Page List block inside navigation block will result invalid html Nov 21, 2024
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 Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants