Open dgdavid opened 1 year ago
We could expose a prop to set the body element to be a div rather than the default span. We would not want the consumer to use this prop if they are using the isLabelWrapped prop.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
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 aspan
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
body
being wrapped in aspan
was requested in a review because the RadioisLabelWrapped
prop. See https://github.com/patternfly/patternfly-react/pull/5559#pullrequestreview-617903386I've created a ~silly~ weird example of a Checkbox using flow content in its body, just for illustrating a possible use case of a React node returning a
div
. 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
--- ![A screenshot of two weird checkboxes with three flexbox columns each one in their bodies](https://github.com/patternfly/patternfly-react/assets/1691872/330aae79-75f4-45ce-91b2-edc332720933)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