Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Allow Label to set button component without onClick

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript
領域
frontend

調査の方向性

Label コンポーネントと既存のテストから始め、onClick が指定されたときにレンダリングされる要素がどのように変わるかを追跡します。onClick なしでボタンを要求するためのサポートされた方法を定義し、既存の使用方法を変更せずに、Label が期待されるフォーカス動作を持つネイティブボタンをレンダリングすることを確認します。

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

説明

PF Team

Describe the enhancement or change
Currently, in order for a clickable Label to render with the button element in the DOM is to pass an onClick handler to it. There may be use cases where an onClick isn't desired - one example being the new Canvas pattern in Chatbot where a clickable Label opens a Popover. In this case the Popover is passed the Label as a child (rather than using triggerRefs and the Label's onClick to dictate the Popover open state).

Allowing Label to set a button element could help in those sorts of scenarios, instead of needing to pass a triggerRef, onClick to Label, and onHidden to Popover (which may result in some funky focus behavior).

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?

Any other information?
Not blocking as there is a workaround of setting role and tabindex on a normal Label, but it lacks some focus styles and it would be better for us to support this internally with native elements.


Jira Issue: PF-4637

主要言語
TypeScript
スター
862
フォーク
392
平均マージ
4日 8時間
マージ済み PR(30日)
9

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

patternfly/patternfly-react のほかの issue

patternfly/patternfly-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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