ContentPicker: invalid html

オープン
#400 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@s3rgiosan がすでに取り組んでいます。

2026年11月14日 から。

  • #422 @s3rgiosan による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
frontend

調査の方向性

components/content-picker/PickedItem.tsx から始め、特にレポートで関連付けられている TreeGridRow と PickedItemContainer の構造を確認します。ContentPicker の search-items マークアップと WordPress TreeGrid のガイダンスを調べ、必要な table および ul の子構造を特定します。項目を追加したときに validateDOMNesting の警告なしで有効な HTML が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

There will be Warning: validateDOMNesting(...): <div> cannot appear as a child of <tr>. in console, when adding items to ul.block-editor-link-control__search-items

This happens because the component uses <TreeGridRow><PickedItemContainer> -structure where <PickedItemContainer> is just div. See https://github.com/10up/block-components/blob/develop/components/content-picker/PickedItem.tsx#L27

TreeGrid and related components should be used in <TreeGrid><TreeGridRow><TreeGridCell> -structure, which will render valid html structure for <table>. See https://developer.wordpress.org/block-editor/reference-guides/components/tree-grid/

Also there is invalid html structure in the ul.block-editor-link-control__search-items element, which has div-element as children. This is not allowed according to the specs https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ul#technical_summary

Image
Steps to Reproduce
Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
主要言語
TypeScript
スター
330
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

10up/block-components のほかの issue

10up/block-components の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。