Skip to content

Pass inert as a string in the editor previews - #61

Merged
roborourke merged 1 commit into
mainfrom
claude/bug-validation-fixes-07a61k-issue-14
Sep 2, 2026
Merged

Pass inert as a string in the editor previews#61
roborourke merged 1 commit into
mainfrom
claude/bug-validation-fixes-07a61k-issue-14

Conversation

@roborourke

@roborourke roborourke commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes #14.

Reproduced

Opening a page with either filter block in the editor logs, once per rendered control:

Warning: Received `true` for a non-boolean attribute `inert`.
If you want to write it to the DOM, pass a string instead: inert="true" or inert={value.toString()}.
    at select
    at div
    at edit (…/build/post-type/index.js…)

React 18 does not know inert as a boolean DOM property, and the bare JSX attribute passes it true. 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' in block-editor and components).

Changes

  • src/taxonomy/edit.js, src/post-type/edit.js: inertinert="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 about inert, a non-boolean attribute, or an invalid DOM property. First editor coverage in the suite; it uses the authentication state global-setup.js already 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

Open WordPress Playground Preview

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
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Playwright — PHP 8.3 / WP 6.8

passed  22 passed

Details

stats  22 tests across 5 suites
duration  28.4 seconds
commit  87eb476

@roborourke
roborourke marked this pull request as ready for review September 2, 2026 11:39
@roborourke
roborourke merged commit f5bc1dd into main Sep 2, 2026
9 checks passed
@roborourke
roborourke deleted the claude/bug-validation-fixes-07a61k-issue-14 branch September 2, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inert attribute causing React warning in block-editor

2 participants