patternfly / patternfly/patternfly-react

Allow Label to set button component without onClick

Offen
#12,652 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

PF Team
Vorherrschende Sprache
TypeScript
Sterne
862
Forks
392
Ø Merge
4 T. 8 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei der Label-Komponente und ihren bestehenden Tests und verfolge dann, wie sich das gerenderte Element ändert, wenn onClick angegeben wird. Definiere die unterstützte Möglichkeit, einen Button ohne onClick anzufordern, und überprüfe, dass Label einen nativen Button mit dem erwarteten Fokusverhalten rendert, während die bestehende Verwendung unverändert bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.