patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

Bug - ClipboardCopy - preview for expansion variant does not stringify properly for all allowed types

Open wise-king-sullyman opened this issue 1 year ago • 1 comments

Describe the problem Follow up to #9711 as the previous fix had to be reverted because it was an unintentional breaking change.

The new approach should solve the issue without limiting the allowed types of ClipboardCopy to only a string.

A potential solution is that:

  • the expansion preview (or maybe expansion variant?) should not allow react node child
  • documentation is improved to let users know that if they do indeed pass something other than string as the child, they will need to override onCopy

Expected behavior Expansion variants do not provide an improperly stringified preview

Screenshots image

CC @gitdallas

wise-king-sullyman avatar Feb 26 '24 22:02 wise-king-sullyman

Although I'm unsure what people may want to add to the expansion variant other than a string, I don't want to assume people won't have some requirement to do so. I think it may be suitable to use the outcome of onCopy as the value to put in the expansion preview.

gitdallas avatar Feb 27 '24 14:02 gitdallas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar May 20 '24 11:05 github-actions[bot]

This issue has been closed because it has not had activity since being marked as stale.

github-actions[bot] avatar Jun 04 '24 11:06 github-actions[bot]