Interactivity API: Fix popover bind hydration#77797
Interactivity API: Fix popover bind hydration#77797cbravobernal wants to merge 2 commits intotrunkfrom
Conversation
0c5d3b7 to
8dd0b92
Compare
|
Size Change: +132 B (0%) Total Size: 7.82 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 1a1d819. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25115682072
|
43f546c to
e02f5a1
Compare
|
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. |
686b36f to
1a1d819
Compare
What?
Closes #77766
Updates
@wordpress/interactivityto Preact10.29.1and aligns Interactivity API hydration-timewp-bindattribute handling with current Preact behavior, including support fordata-wp-bind--popover.Why?
data-wp-bind--popoverwas not setting thepopoverattribute correctly during hydration because the Interactivity API mirrors Preact's DOM attribute handling for hydration, and that mirrored logic did not include Preact's newer special handling forpopover.The lockfile also kept Gutenberg on an older Preact release even though the existing dependency range allowed newer versions, so the dependency and related test expectations needed to be updated together.
How?
preactdependency for@wordpress/interactivityto10.29.1and updatespackage-lock.json.input.valuewhen rerenderingnull/undefined.packages/interactivity/src/directives.tsxso hydration excludespopoverfrom the DOM property assignment path, removes it forfalse,null, andundefined, preserves string values, and serializestrueas a present empty attribute.data-wp-bind--popovervalues:true,false,null,undefined,auto,manual, andhint.Testing Instructions
data-wp-bind › attribute hydration › value is correctly hydrated for different valuestest passes.data-wp-bind › attribute hydration › popover is correctly hydrated for different valuestest passes.Testing Instructions for Keyboard
Not applicable. This does not change user-facing UI or keyboard interactions.
Screenshots or screencast
Not applicable.
Use of AI Tools
This PR was prepared with assistance from AI coding agents in Pi. The generated code, tests, documentation review, and PR description were reviewed by the contributor.