Pass inert as a string in the editor previews - #61
Merged
Conversation
React does not know `inert` as a boolean DOM property, so the bare JSX attribute passes it `true` and every render of a filter block logs "Received `true` for a non-boolean attribute `inert`" into the editor console. WordPress 6.8 through 7.0 all ship React 18.3. Write it as a string, the way core writes it in its own editor markup. Editor specs are new here: they open a fixture page in the block editor and fail on a console warning about a DOM attribute, so this stays fixed. Fixes #14 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lj871x28S1DXjoVm7AB4k5
Playwright — PHP 8.3 / WP 6.8Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14.
Reproduced
Opening a page with either filter block in the editor logs, once per rendered control:
React 18 does not know
inertas a boolean DOM property, and the bare JSX attribute passes ittrue. WordPress 6.8, 6.9 and 7.0 all ship React 18.3.1, so a string is right for every version currently in the field — and it is what core writes in its own editor markup (inert: 'true'inblock-editorandcomponents).Changes
src/taxonomy/edit.js,src/post-type/edit.js:inert→inert="true"on the select, radio and checkbox previews.tests/e2e/editor.spec.js: new editor specs. They open a fixture page in the block editor, wait for the preview to render in the canvas, and fail if the console carried a warning aboutinert, a non-boolean attribute, or an invalid DOM property. First editor coverage in the suite; it uses the authentication stateglobal-setup.jsalready saves.Verification
Both new specs fail on
main(each collecting the React warning) and pass with the fix. Full suite: 22 passed on WordPress 6.8.8 and 7.0.4, React 18.3.1 confirmed in both.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lj871x28S1DXjoVm7AB4k5
Generated by Claude Code