Repository navigation
iAPI: Fix duplicated nested regions - #4
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 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. |
|
Size Change: +15 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
| <div data-wp-ignore> | ||
| <div> | ||
| <div> | ||
| <p |
There was a problem hiding this comment.
We could remove this <p data-testid="no-region-text-2"> as the tests no longer use it.
|
It would be a good idea to include warnings for router regions being rendered as children of interactive elements. 🤔 They would still be interactive, but their markup wouldn't be updated on navigation. |
What?
This PR fixes a bug in which nested router regions were being duplicated after a client-side navigation, which is happening in the upcoming WooCommerce's Product Filter blocks.
Additionally, since a requirement of
data-wp-router-regionis that it must be in the top mostdata-wp-interactive, this PR makes sure to ignore all regions that do not meet that requirement.Why?
Because the nested router regions were being processed when only the top most region should be processed.
How?
Changing the selector to only take into account the regions that are not nested and that also include a top most
data-wp-interactiveelement.