-
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
Image block: Remove unnecessary variables on expand on click implementation #63290
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: -25 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Flaky tests detected in dcac079. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9854969909
|
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.
Thanks for refactoring. Verified the fix and it works as before without any issues.
🚢
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.
Nice, thanks @luisherranz !
Co-authored-by: luisherranz <[email protected]> Co-authored-by: madhusudhand <[email protected]> Co-authored-by: cbravobernal <[email protected]>
What?
I have deleted some unnecessary variables from the implementation of the expand-on-click feature of the image block.
Why?
Because at the time this implementation was done, there was a bug in the Interactivity API: when an element was added to the context or the state, the internal variables of that element tried to become reactive and failed.
That bug was fixed in this pull request, so the variables in this implementation that stored the reference of the button and the reference of the image are no longer needed.
How?
Simply deleting those variables and letting everything be in the context/state.
Testing Instructions