-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add page-list to blocks that needs list item wrapper #61482
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
base: trunk
Are you sure you want to change the base?
Add page-list to blocks that needs list item wrapper #61482
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @nick-novak. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @saulirajala! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
Hey @ajitbohra 👋 Any change to get this fixed before WP6.7 release? |
|
@saulirajala Thanks you for the PR and for your diligence in updating it in line with changes for WP 6.7. I've requested reviews from a few folk familiar with the block so hopefully we can get some reviews soon. |
|
Thanks for making the PR, sorry for the delay in anyone getting back to you. In terms of the solution, I think it might be better to go the other way, and remove the Page List's use case in the navigation block is a quick way to add a set of navigation links, and any other individual navigation links added alongside it should appear visually as the same set of links, and also be that way in terms of the HTML hierarchy. (IMO) It looks like there's precedence for this, as if you add Page List in a submenu alongside a custom link, it already works that way, the
Here's where it's determined. It might be a simple adjustment to make this work: gutenberg/packages/block-library/src/page-list/edit.js Lines 264 to 280 in 5513d7a
@draganescu's PR #46414 implemented that, so Andrei might have some advice. |
|
@saulirajala Do you feel you would have time to make the adjustments here? No rush but wanted to check as it's on my radar to keep track of. Thank you. |
|
@talldan personally I don't dislike the idea provided by @saulirajala when I first saw this report, this was the first idea that popped into my mind This was my original reasoning:
I think the problem that @saulirajala found back in the day #61475 was:
And then he got to this conclusion (and solution) like me. It's true that by default, this solution, completely blows styles for the nav items in the front for TT5 Ideas? cc @getdave |
Ok, I didn't realize there was a previous PR. 😄 I think the problem with omitting the
This is one of those problems where we have to weigh up the trade-offs. Option 1 - Keep the invalid markupPros - Maintains the status quo where things kind of work Option 2 - Omit the
|
|
@joedolson what do you think about first option from a @talldan any of the options that involve a change are going to cause backwards compatibility massive issues. But personally, I truly believe that the Option 3 is the most elegant in all regards. Yet, it will be a hit for all themes. And Option 2 will affect all users who are actually targeting this block, plus the code will be much more dirty. Difficult decision, I don't have enough experience to know how to tackle backwards compatibilities in Gutenberg. For now, I'm going to re-add |

What?
Wrap
core/page-listwith list item wrapper when its innerBlock ofcore/navigationCloses #60500
Why?
Fix for #60500. When you use page-list -block as inner block of navigation block, there will be invalid html code
<ul><ul><li></li></ul></ul>-structure in the frontend.Testing Instructions
<ul><li><ul><li></li></ul></li></ul>-structure, which is valid htmlScreenshots
Before

After
