patternfly / patternfly/patternfly-react
Allow Label to set button component without onClick
Dieses Issue hat noch niemand übernommen.
- 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
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Ö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