-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Interactivity API: fix namespaces in nested interactive regions #57029
Conversation
Size Change: +10 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in dab4e13. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7220386069
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described. There is a conflict with the changelog that we should fix before merging.
Good job!
d45725d
to
dab4e13
Compare
* Add failing test * Turn namespaces into a stack inside `toVdom` * Add changelog entry
What?
Fixes a problem with namespaces not being restored when a nested interactive region changes it. E.g.:
Why?
The case described above makes
state.message
not to be resolved correctly because it tries to readmessage
from namespace B. It likely returns an error like the following:We need to ensure the property is read from the right namespace.
How?
A single variable to store the current namespace was used before. I replaced that with a namespace array that works as a stack.
Testing Instructions
To reproduce the issue:
trunk
. In the editor, go to the home blog template.To verify the fix: