patternfly / patternfly/patternfly-react
Checkbox/Radio - allow flow content as body
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 862
- Forks
- 392
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 9
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Checkbox and Radio components and inspect how their body prop is wrapped, including the isLabelWrapped behavior referenced in the issue. Determine whether flow content can be supported without breaking the existing label behavior; done means both components accept the intended content, or the Checkbox documentation clearly states that body content must be phrasing content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100