patternfly / patternfly/patternfly-react
Checkbox/Radio - allow flow content as body
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 862
- Fork
- 392
- Merge medio
- 4g 8h
- PR unite (30g)
- 9
Descrizione
Is this a new component or an extension of an existing one?
Existing components, Checkbox and Radio.
Describe the feature
To allow flow content for their body prop. Currently it's wrapped in a span element, which only admits phrasing content.
Are there visuals for this feature? If applicable, please include examples for each state and for varying widths
I don't think so.
Any other information?
-
The
bodybeing wrapped in aspanwas requested in a review because the RadioisLabelWrappedprop. See https://github.com/patternfly/patternfly-react/pull/5559#pullrequestreview-617903386 -
I've created a
sillyweird example of a Checkbox using flow content in its body, just for illustrating a possible use case of a React node returning adiv. See https://codesandbox.io/s/weird-patternfly-checkbox-91mzqq or the screenshot uploaded belowClick to show/hide a screenshot of the output from the Codesanbox pasted above
-
If the change isn't possible beacuse the benefit does not pay off complicating the code for these components, at least it would be nice to mention in the documentation that the expected React.ReactNode must return phrasing content only
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con i componenti Checkbox e Radio e verifica come viene racchiusa la loro prop body, incluso il comportamento isLabelWrapped menzionato nell’issue. Determina se è possibile supportare flow content senza compromettere il comportamento esistente di label; il lavoro è completo quando entrambi i componenti accettano il contenuto previsto oppure la documentazione di Checkbox dichiara chiaramente che il contenuto di body deve essere phrasing content.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react, typescript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100