patternfly / patternfly/patternfly-react

ClipboardCopy - custom wrapper component

Open
#11,306 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale
Dominant language
TypeScript
Stars
862
Forks
392
Avg merge
4d 8h
Merged PRs (30d)
9

Description

ClipboardCopy uses a div element to wrap everything and style the element. When using the component in conjunction with a markdown viewer, this ends up generating invalid html if the ClipboardCopy is used to style inline <code> tags.

An example is this visualization which comes from a markdown content rendered using react-markdown, customized to use ClipboardCopy and CodeBlock components (for single-line and multi-line snippet of code respectively) to style the code tags (visible at the bottom of the screen):

Image

which generates this warning:

Image

This could be solved by either defaulting the ClipboardCopy to use a span element by default, or by providing a customization property for the wrapping element as done for other components in the library.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the ClipboardCopy component implementation and its tests, then inspect how its div wrapper behaves when used around inline code elements from a markdown viewer. Done means the component supports the requested wrapper behavior, either through a span default or a wrapper customization property, without generating invalid HTML.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.