Separator adds a redundant role="separator" to its default <hr>

オープン 初心者向け
#10,894 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Janani-bn がすでに取り組んでいます。

2026年11月2日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
html, react, typescript

調査の方向性

Separatorの実装と、それが呼び出すuseSeparatorのロジックを読み、デフォルトの要素タイプhrがどのように渡されるかに注目してください。<Separator />で問題を再現し、レンダリングされたhrに冗長なroleがないこと、明示的に選択されたhr以外の要素は意図された動作を維持することを確認してください。

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

説明

Provide a general summary of the issue here

<Separator /> renders <hr role="separator">.

Separator falls back to 'hr' (let Element = elementType || 'hr') but passes the original, undefined elementType to useSeparator, whose if (props.elementType !== 'hr') then adds the role. Passing elementType="hr" explicitly avoids it.

HTML validators flag the redundant role (html-validate no-redundant-role).

🤔 Expected Behavior?

an <hr> without role="separator".

😯 Current Behavior

<hr role="separator">, because Separator passes the original elementType (undefined) to useSeparator, not the 'hr' it renders.

💁 Possible Solution

pass elementType: Element to useSeparator.

🔦 Context
🖥️ Steps to Reproduce

<Separator />

Version

react-aria-components 1.21.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

OS X

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

主要言語
TypeScript
スター
16k
フォーク
1.6k
平均マージ
2日 17時間
マージ済み PR(30日)
41

環境構築

はじめの一歩

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

adobe/react-spectrum のほかの issue

adobe/react-spectrum の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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